User image borders

User image borders

by David Scotson -
Number of replies: 0
I was changing the user image code so that it outputted a 16x16 image (because you can't resize images used as backgrounds) and while I was looking at the code I experimented with a different technique for adding the border to the image.

before

f1.jpgf2.jpgf2.jpg

In these a one pixel border is added to the two larger images, and the smallest image is created by allowing the browser to resize the image.

after

f1.jpgf2.jpgf3.jpg

Here all three images are created by GD, but the second and third are bicubicly resized from the first after the border is added, rather than from the original image. This double resize adds a generational quality loss but it also allows a sub-pixel border: 0.35 pixels for the middle one and 0.16 for the smallest. I think I prefer it but it's obviously an aesthetic call. (I might experiment by doubling the width of the border on the original before it is resized to give 0.75 and 0.32 pixel borders.) Does anyone else think this is an improvement?

Average of ratings: -