JPEG to GIF without loosing quality
JPEG to GIF without loosing quality
Author
Discussion

jamesuk28

Original Poster:

2,176 posts

284 months

Friday 27th April 2007
quotequote all
Is there a way of converting a jpeg to a gif without loosing the quality of the image?

Globulator

13,847 posts

262 months

Friday 27th April 2007
quotequote all
jamesuk28 said:
Is there a way of converting a jpeg to a gif without losing the quality of the image?


GIF is lossless - no quality issue. Quality is only lost when creating a lossy file format.

There are many methods:

Method 1)
On a Mac (which can also run imagemagick of course) just view the picture in Preview, and then Save As a GIF file. QED.

Method 2)
Install imagemagick

Assuming you are running Linux/Mac and have the command line (maybe the same in windows?!)

Type:
convert input.jpg output.gif

GIF is lossless, so you will not lose quality unless you go back to jpeg.
i.e.
convert input.gif -quality 80 output.jpg

The greater the quality, the bigger the jpeg file.

ThePassenger

6,962 posts

266 months

Friday 27th April 2007
quotequote all
Someone correct me if I'm wrong, but isn't GIF limited to 256 colours? If the JPEG is 16, 24 or 32 bit... I think you'll be loosing quality if that is the case.

markduffy

634 posts

237 months

Friday 27th April 2007
quotequote all
ThePassenger said:
Someone correct me if I'm wrong, but isn't GIF limited to 256 colours? If the JPEG is 16, 24 or 32 bit... I think you'll be loosing quality if that is the case.


nope, you are correct it is limited to 256 colours

tog

4,975 posts

259 months

Saturday 28th April 2007
quotequote all
gif is good for graphics, but not much use for photos unless they're used very small on the web.

PJ S

10,842 posts

258 months

Saturday 28th April 2007
quotequote all
ThePassenger said:
Someone correct me if I'm wrong, but isn't GIF limited to 256 colours? If the JPEG is 16, 24 or 32 bit... I think you'll be loosing quality if that is the case.


yes
PNG is a better option to retain quality.

ThePassenger

6,962 posts

266 months

Saturday 28th April 2007
quotequote all
PJ S said:
ThePassenger said:
Someone correct me if I'm wrong, but isn't GIF limited to 256 colours? If the JPEG is 16, 24 or 32 bit... I think you'll be loosing quality if that is the case.


yes
PNG is a better option to retain quality.


But will play havoc with IE6 if it's used on the web. Especially if it's got transparent bits.

zaktoo

805 posts

238 months

Saturday 28th April 2007
quotequote all
ThePassenger said:
PJ S said:
ThePassenger said:
Someone correct me if I'm wrong, but isn't GIF limited to 256 colours? If the JPEG is 16, 24 or 32 bit... I think you'll be loosing quality if that is the case.


yes
PNG is a better option to retain quality.


But will play havoc with IE6 if it's used on the web. Especially if it's got transparent bits.



To be fair though, quite a lot trips up IE in all its various flavours. There is no reason for IE not to work well with PNG images except corporate interests at play. Use PNGs for what they were designed, and FU Microsoft for putting corporate agenda before your users. IMHO. May contain traces of nuts. Keep away from direct sunlight.

Skier

488 posts

254 months

Saturday 28th April 2007
quotequote all
If you want something quick, easy and free to do conversions between all sorts of formats download Irfan view from: www.irfanview.com

Others can debate the merits of different formats but for simple file format manipulation and a whole host of other functions this utility is tough to beat.

Regards

Skier

Globulator

13,847 posts

262 months

Saturday 28th April 2007
quotequote all
Sorry - forgot about the 256 colour palette. Not sure if imagemagick has any options for rendering to a limited palette but it may.

On a modern IE6 PNGs work but the transparency is chopped to a binary level. A modern website script can sometimes get around this by serving the correct GIF, created on the fly using imagemagick on the server, and simply sends the PNGs only to working browsers; while the webmaster curses microsoft for the extra work they've given him and millions of others like him.

<rant-on>Apparantly the largest and richest software company in the world, one who frequently updates IE6 with patches via the Windows Updates scheme, can't grasp the concept of alpha blending. Or maybe the billions of dollars spend on lawsuits prevented them from hiring a contractor for 5 minutes to fix it.
Which probably explains how it took them 5 years to do it in Vista, when Mac/Linux/Beos - and in fact any non IE browser - had it nailed years ago.</rant-off>

jamesuk28

Original Poster:

2,176 posts

284 months

Saturday 28th April 2007
quotequote all
GUYS should have made clear the image is a logo currently in jpeg format. It is being uploaded through a domain file manager to a directory in an ecommerce package. IE we are replacing the current logoHeader.gif so it has to be in gif format, unless we rewrite some of the code which we don't have permission to do.

Obviously the conversion from jpeg to gif pixelates the image, we can clean it up but its still not sharp enough, guess we are stuffed then.

jamesuk28

Original Poster:

2,176 posts

284 months

Saturday 28th April 2007
quotequote all
Overcame it by converting a jpeg to bmp then to gif. Seemed to have minimal distortion and cleaned up OK.

zumbruk

7,848 posts

291 months

Saturday 28th April 2007
quotequote all
Skier said:
If you want something quick, easy and free to do conversions between all sorts of formats download Irfan view from: www.irfanview.com

Others can debate the merits of different formats but for simple file format manipulation and a whole host of other functions this utility is tough to beat.


Hear, hear. irfanview is one of the first things I install on a new PC.