Page 1 of 2 [ 28 posts ]  Go to page 1, 2  Next

digger1
Veteran
Veteran

User avatar

Joined: 12 Sep 2007
Gender: Male
Posts: 3,485

27 Feb 2009, 8:37 pm

why are my gifs saving weird?

original:

Image

saved as gif:

Image

see the specks?



zghost
Veteran
Veteran

User avatar

Joined: 28 Oct 2007
Age: 49
Gender: Female
Posts: 1,190
Location: Southeast Texas

27 Feb 2009, 8:41 pm

No I don't, they look completely identical to me.



digger1
Veteran
Veteran

User avatar

Joined: 12 Sep 2007
Gender: Male
Posts: 3,485

27 Feb 2009, 8:46 pm

Image



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 75
Gender: Male
Posts: 9,619
Location: Somerset UK

27 Feb 2009, 9:02 pm

Indeed, they appear identical to me too.

Your first image (the JPEG) is 258,408 bytes

The second image (the GIF) requires only 145,947 bytes.

When I save the JPEG as GIF, using GIMP, it takes up 163,028 bytes. What did you use?

And.... GIF is wholly inappropriate for saving photographic images. It is restricted to 256 distinct colours, and therefore will usually be unable to maintain smooth gradients with multiple shades of colour. A single gradient is not too great a problem, but photographic image data is not like that.

http://en.wikipedia.org/wiki/GIF

Actually, as it says it the article, there are dubious ways that more than 256 colours can be "fudged", but they may not work.


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


Last edited by lau on 27 Feb 2009, 9:20 pm, edited 1 time in total.

lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 75
Gender: Male
Posts: 9,619
Location: Somerset UK

27 Feb 2009, 9:10 pm

(I notice that GIMP stores in GIF 87a format, rather than 89a, which might explain why my GIF was larger, in the prior post.)

To accentuate the effect, this is your image, when I force it to have only 32 colours:

Image

That is the 89a format, and produced by:

Code:
gifsicle -k 32 < 1plantgif.gif > 1plantgif32.gif


I'm surprised it is still as good an image as it is.


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


Last edited by lau on 27 Feb 2009, 9:22 pm, edited 1 time in total.

lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 75
Gender: Male
Posts: 9,619
Location: Somerset UK

27 Feb 2009, 9:19 pm

As a comparison of GIF/JPEG, the previous image (with 32 colour GIF) still took 74,153 bytes.

This image, which is 20% JPEG, and maintains a much better photographic quality, takes merely 12,790 bytes.
Image


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


twoshots
Veteran
Veteran

User avatar

Joined: 26 Nov 2007
Age: 38
Gender: Male
Posts: 3,731
Location: Boötes void

27 Feb 2009, 9:51 pm

I can't tell by eye, but if your problem is specks, that ought to be expected as gifs are 256 color.


_________________
* here for the nachos.


AdvilPM
Yellow-bellied Woodpecker
Yellow-bellied Woodpecker

User avatar

Joined: 18 Feb 2009
Age: 52
Gender: Male
Posts: 50

27 Feb 2009, 11:03 pm

they don't appear identical to me. What's all that white stuff on the leaves?



digger1
Veteran
Veteran

User avatar

Joined: 12 Sep 2007
Gender: Male
Posts: 3,485

27 Feb 2009, 11:05 pm

paint



twoshots
Veteran
Veteran

User avatar

Joined: 26 Nov 2007
Age: 38
Gender: Male
Posts: 3,731
Location: Boötes void

27 Feb 2009, 11:34 pm

Yeah, it's just the fact that gif converts it to 256 colors. I actually got somewhat worse results when I tried converting it in GIMP. If you want higher quality, choose a better format.


_________________
* here for the nachos.


roadracer
Veteran
Veteran

User avatar

Joined: 9 Nov 2008
Age: 40
Gender: Male
Posts: 778

28 Feb 2009, 12:16 am

I picked it up right away, being a photographer. Color profile!! When converting a picture between differnt formats each format uses slightly differnt colors. Pretty much the gif cant use as many colors as the original jpg file, so it uses dithering between each pixel to fill in the emty pixels, it guess this by the using the color of the pixel beside it. So you are better off using jpg for pitures when ever posible and saving gif for graphics that have few colors.



roadracer
Veteran
Veteran

User avatar

Joined: 9 Nov 2008
Age: 40
Gender: Male
Posts: 778

28 Feb 2009, 12:28 am

Here is a article on color managment, pretty much for best results, use the same color profile that you camera uses threw all the processing and editing to your final picture, for best results

http://en.wikipedia.org/wiki/Color_management



0_equals_true
Veteran
Veteran

User avatar

Joined: 5 Apr 2007
Age: 41
Gender: Male
Posts: 11,038
Location: London

28 Feb 2009, 7:48 am

It is called dithering. Gif doesn't have a good compression algorithm, so uses a limited color index as an alternative. If it doesn't have the have the right colour or tone it can use the nearest equivalent or to dither (which is a pointillism). If you turn off dither it will look even worse for that number of colours.

In short don't use gif to save high quality photos.



Last edited by 0_equals_true on 28 Feb 2009, 7:53 am, edited 1 time in total.

lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 75
Gender: Male
Posts: 9,619
Location: Somerset UK

28 Feb 2009, 7:51 am

roadracer wrote:
Here is a article on color managment, pretty much for best results, use the same color profile that you camera uses threw all the processing and editing to your final picture, for best results

http://en.wikipedia.org/wiki/Color_management

Colour profile is a whole different ball game. It has nothing to do with digger1's problem - where the overall colour values are identical on both images. The paucity of colours in the GIF format causes easily spotted artefacts due to quantization/


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


0_equals_true
Veteran
Veteran

User avatar

Joined: 5 Apr 2007
Age: 41
Gender: Male
Posts: 11,038
Location: London

28 Feb 2009, 8:00 am

lau wrote:
roadracer wrote:
Here is a article on color managment, pretty much for best results, use the same color profile that you camera uses threw all the processing and editing to your final picture, for best results

http://en.wikipedia.org/wiki/Color_management

Colour profile is a whole different ball game. It has nothing to do with digger1's problem - where the overall colour values are identical on both images. The paucity of colours in the GIF format causes easily spotted artefacts due to quantization/


Also some of those spots may not be even close to the colour but the approximately the right tone.



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 75
Gender: Male
Posts: 9,619
Location: Somerset UK

28 Feb 2009, 8:02 am

0_equals_true wrote:
It is called dithering. Gif doesn't have a good compression algorithm, so uses a limited color index as an alternative. If it doesn't have the have the right colour or tone it can use the nearest equivalent or to dither (which is a pointillism). If you turn off dither it will look even worse for that number of colours.

In short don't use gif to save high quality photos.


I don't believe dither has much to do with it either. GIFs don't generally use that. In fact, it tends to result in pretty gruesome effects, overall, on an image - especially when the pseudo-random algorithm has too long (surprisingly) a period. It can tend to "fudge" the non-dithered artefacts, but does so by blurring the overall image, and also can introduce its own set of artefacts.

The GIF compression is fairly good - when applied to the sort of image it is intended for, which is NOT photographic ones.


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer