Page 1 of 1

Can gif image have same quality as PNG image?

Posted: 2016-09-14T06:53:35-07:00
by agriz

Code: Select all

convert any.png any.gif
Both are having different quality. fuzz, -layers OptimizePlus are not proving good results.
For transparency we can use some matching background color. But the whole image is not as good as png.

What is the best solution?
Image
Image

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T07:22:16-07:00
by Bonzo
I would guess your problem is a gif is limited to 256 colours.

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T07:23:55-07:00
by agriz
What does it mean? How can i fix that problem?

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T07:36:38-07:00
by agriz
How many colors do png support when comparing with gif?
Is there any solution for this? I have seen good gif images.

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T07:43:56-07:00
by Bonzo
From what I have read .png images can have 256 trillion colours.

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T07:49:20-07:00
by agriz
256 trillion vs just 256 colors?
Is it imagemagick or general?
How come images are good in gif?

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T08:27:18-07:00
by snibgo
Each pixel in a 16-bit/channel/pixel PNG file can be one of 2^48 = 281,474,976,710,656 different colours.

Each pixel in a GIF file can be one of 256 different colours. This isn't quite as bad as it sounds, because each of those colours is chosen from a list of 2^24 = 16,777,216 colours. Provided the image is fairly simple, and the 256 colours are chosen intelligently, and we don't look closely, GIF isn't too bad.

These are limits of the file formats, nothing to do with ImageMagick.

If we are counting colours, pixels in a 32-bit/channel/pixel TIFF file can be one of 2^(32*3) = 79,228,162,514,264,337,593,543,950,336 different colours.

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T08:38:09-07:00
by agriz
GIF is not too bad. But it is not as good as png. I never used TIFF. It must be super!
If i work with lower quality images, the output gif is really bad. :(

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-14T08:47:48-07:00
by snibgo
The human eye can distinguish only about 100 levels per channel, so an 8-bit/channel/pixel image is usually good enough, as a final output image. But if we need to process the image, the processing might lose a few bits, so we want the best possible input image.

I do a huge amount of varied image processing, and the only time I need 32-bit/channel/pixel is when those "images" are really displacement maps.

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-15T06:23:39-07:00
by agriz
Original Image : JPEG
Image

ImageMagick
Image

Photoshop
Image

Photoshop is looking better than Imagemagick.
How?

I converted few images to gif but they are really worst. There should be an option to improve it.

Original
Image
Photoshop
Image
Imagemagick
Image

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-15T06:33:30-07:00
by snibgo
You have a reasonable JPG image that has 64932 different colours. From that, you make a GIF image that has far fewer colours and a larger filesize (more bytes). Why? What are you trying to do?

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-15T06:40:46-07:00
by agriz
Sir, I am animating them.

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-15T07:05:40-07:00
by snibgo
For best-quality animated GIFs from a series of photos, I suggest you use ffmpeg, not ImageMagick.

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-15T07:08:10-07:00
by agriz
No. I need to composite images and add effectss

Re: Can gif image have same quality as PNG image?

Posted: 2016-09-15T07:21:42-07:00
by snibgo
Yes, you can process the individual frames with IM. You can do that with maximum bit depth, to keep the quality high. When you want to assemble the frames into a GIF, I suggest you use ffmpeg for that processing.