LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Graphics: PNG (or whatever) to GIF (without losing quality) (https://www.linuxquestions.org/questions/linux-software-2/graphics-png-or-whatever-to-gif-without-losing-quality-540502/)

robbbert 03-25-2007 02:50 PM

Graphics: PNG (or whatever) to GIF (without losing quality)
 
Hi, I have a set of PNG files and I'm trying to convert them to GIF (as Internet Explorer < 7.0 can't handle transparent PNGs).

I tried using "The" GIMP, Pixel Image Editor (in this case, I'd "optimized the image for GIF" before saving it), Krita, and ImageMagick.

The output in any case looks the same: scattered, pixelized.

As I remember, I'd experienced the same problem before, using Photoshop, Paint Shop Pro, and some other imaging software. Wait, some elder Photoshop version (4.0?) had an option to "export an optimized web image", and that worked roughly.

The problem is not the source format, or conversion, I think, but the output format. Anyways -

Any idea how to resolve my task?

Thanks

ilikejam 03-25-2007 03:38 PM

Hi.

Code:

convert img.png img.gif
should create a perfect copy. Not sure why it's not working for you, though.

Dave

robbbert 03-26-2007 12:09 PM

That's what I did, thanks.
Here's the image before and after...

That's hosted by imageshack.us BTW. Make sure your popup blocker is "on" ^^

ilikejam 03-26-2007 03:31 PM

Ah. The problem is that your image has transparent, but coloured areas. GIF can only do on-off transparency, which is what's causing the blocky-ness. Anything not 100% transparent is being tranformed into a colour.

If the background for the page is going to be white, then you can create a white 32x32 square (or whatever size your image is in general), and do
Code:

composite reloadxc6.png white.png reloadxc6.gif
and you'll have a smooth GIF image. You'll lose the transparency, though.

Dave

robbbert 03-28-2007 03:00 PM

Thanks!

Quote:

Originally Posted by ilikejam
Ah. The problem is that your image has transparent, but coloured areas. GIF can only do on-off transparency, which is what's causing the blocky-ness. Anything not 100% transparent is being tranformed into a colour.

Sorry, I didn't understand that, at all...

Quote:

Originally Posted by ilikejam
If the background for the page is going to be white, then you can create a white 32x32 square (or whatever size your image is in general), and do
Code:

composite reloadxc6.png white.png reloadxc6.gif
and you'll have a smooth GIF image. You'll lose the transparency, though.

Losing transparency would not be an option, unless transparency could be added again.

Thanks again

Zention 03-28-2007 03:07 PM

PNG has an alpha channel; blending colours with background.

GIF has transparency; showing background colour.

The places where the alpha channel is being used to blend a colour with the colour below (alpha channel) are problematic should it go to the colour or become transparent, that is the dilemma when converting to gif.

I am fairly sure IE7 supports png now.

But, there are some posts pertaining to it being a bit of a scam.

Gimp is slightly better at a default conversion.

I am sure there are workarounds for IE7 though.


All times are GMT -5. The time now is 05:35 AM.