|
|
|
User Rating: Rated by: |
Good (3.2/5) 25 user(s) |
|
|
|
Alpha Icon Creator description |
|
|
Alpha Icon Creator - create 32-bit icons with alpha channels in multiple sizes from a single bitmap source image
With Alpha Icon Creator you will be able to create 32-bit icons with alpha channels in multiple sizes from a single bitmap source image using Alpha Resampling to create smartly downsized images with smooth, blended edges.
Alpha Icon Creator has a very simple interface; first select a bitmap that you want to resample down to create the icons. The code will automatically pick the colour of the top, left pixel of the image as the transparent colour but you can choose an alternative colour if necessary. Then choose the icon sizes you want to create, a file name for the icon and click next, and the image is resampled and the icon created.
For best results, the source image should be an even multiple of each of the icon sizes you want to create. For example, if you want to create 16x16, 32x32 and 48x48 icons, then a source image of size 480x480 is a good choice since this is evenly divisble by each icon size (480/16 = 30, 480/32 = 15, 480/48 = 10). The code still works for images of any size, but it has to do more work to calculate the fractional contribution of source pixels that straddle multiple pixels in the output.
The concept of resampling an image and using an alpha channel to feather the edges is described in the Alpha-DIB section article Alpha Resampling. The idea is that you start with a single, pixel accurate bitmap of a much larger size to the image you want to draw. Then you assign the background colour of the bitmap as the "transparent" colour.
This colour is then mapped so that in the destination image it has an alpha value of 0, i.e. the destination pixels are completely transparent. Then say you want to create a version of the image that is 1/4 of the size. Each pixel in the smaller version of the image corresponds to 16 pixels (4 x 4) in the source image.
Then, rather than just averaging the colours in each of the source pixels to create the output pixel, you take both the colour average for non-transparent pixels and the average overall alpha of the 16 pixel cell. The result is then the colour average with the overall alpha applied. This means that a 4 x 4 block that is half filled with black pixels will result in a single black pixel in the output with 50% transparency, and as a consequence the sampled-down image looks much smoother to the eye.
|
|