Sunday, April 4, 2010

Resizing and Resampling

                            


Getting Rid of the Sparklies




Click image to enlarge
Gif image resized to 800x600 without resampling. Original 3000x2250



Click image to enlarge
Resampled jpg image at 800x600. Original gif 3000x2250


Another example

 
Click image to enlarge
Gif image resized to 800x600 without resampling. Original 3000x2250

 
 Click to image enlarge
Resampled jpg image at 800x600. Original gif 3000x2250.



       Compare the same sized gifs and jpgs.The sparklies in the gifs are reduced in the jpgs. The jpgs were anti-aliased (de-sparkled) by loading them into IrfanView,increasing color depth to 16.7 million colors,resizing to 800x600 and sharpening before saving . A bit about resizing.There are two kinds of resizing-brute force and resampled. In the brute force method pixel information that does not correspond to the horizontal and vertical position in the matrix of the final image is thrown away. Suppose the image is reduce 4 to 1. In this case the information of every 4th pixel is kept and the information of the other 3 pixels is ignored. Irfanview calls this resizing and Paint Shop Pro calls it pixel resize. In the other method information about the final pixel is product of the original pixels information and the information about its neighbours. Irfanview calls this resampling,Paint Shop Pro calls it Smart Size. In this method the number of colors in the final image is often greater than the original so to get the maximum effect the color depth of the final image should be greater than the original. Color depth means the maximum number of colors the image can contain. Example-in a gif the maximum number of colors any one image can have is 256 although the gif has a pallete of 16.7 million colors to choose from.I choose a color depth of 16.7 million colors.Resampling while it often gets rid of the "sparklies" in a gif fractal it tends to soften the image.Try sharpening the image before saving it.Resizing is not a perfect solution.Image area increases by the product of increase of the size of the width and height-increase the sides by 3 times the area increases 9 times and so does the calculation time and that's not taking into account the possible slow down caused by switching from solid guessing to passes=1 mode

No comments: