tags:

views:

14

answers:

1

Seems this issue doesn't exist for .jpg images, any reason for this?

Original:

alt text

Output:

alt text

A: 

The problem is that .gif supports only 1-bit alpha. If you open up those images in a paint program, you'll see that the larger one has a lot of white around the outside where the anti-aliasing is happening, but the smaller one has much of that anti-aliasing removed. It's not really the fault of ImageMagick, since there's not much it could do anyway.

I would suggest that .png is a better choice for these images instead of .gif. If you really must use .gif, then get rid of the alpha completely (it's not going to look nice on anything but a white background anyway).

Dean Harding
What do you mean by **anti-aliasing** ?
wamp
@wamp: anti-aliasing is what makes the image look smooth. It generally doesn't work well with the 1-bit alpha that gif supports.
Dean Harding
Why doesn't it work well? The issue doesn't happen with `jpg`
wamp
@wamp: It doesn't happen with jpg because jpg does not have an alpha channel at all. As I said, either remove the alpha mask from the original .gif file, or switch to a format that supports *full* alpha (such as .png).
Dean Harding
Why is 1-bit alpha so special?
wamp