cr2 to png problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
naphelge

cr2 to png problem

Post by naphelge »

hi,

i will mention right off the bat i am no photo guru. i have about 120 cr2 (canon raw format) photos i would like to convert to png files.

i am using ubuntu and the command line using convert, which once i get the results i am looking for i think i should be able to batch convert using the same command with mogrify.

my problem is the original file sizes are around 15-18 megs each. i run... $ convert IMG_0735_01.CR2 image735.png
and i end up with a png file that is like 60 megs. i have tried using -quality and -depth options to reduce the size but no matter what the file converts to the same ballooned 60 megs.

when i use gthumb and convert the cr2 to png the resulting png file is the same size as the original cr2 file (~16megs), which is what I am looking for. so if someone could please help me out, i dread the idea of convert these one by one using gthumb.

cheers,
nap
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: cr2 to png problem

Post by magick »

We need to reproduce the problem before we can comment. Post a URL to one of your images and we will get back to you after we have a chance to analyze it.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: cr2 to png problem

Post by snibgo »

Does gthumb make thumbnails, ie images with smaller dimensions?

Png doesn't compress photos well. A common program "pngcrush" might shrink them a little. But if you want smaller filesizes, try jpg.
snibgo's IM pages: im.snibgo.com
naphelge

Re: cr2 to png problem

Post by naphelge »

We need to reproduce the problem before we can comment. Post a URL to one of your images and we will get back to you after we have a chance to analyze it.
well I just assumed I (the user) was the problem, not being very familiar with the options, I was perhaps missing something.

I do not post my photos online nor do I have a way to do so, I connect to the Internet sparingly using via GPRS and although it is deathly slow it eventually gets the job done. So, uploading large files for a problem I am certain is really just me does not make sense.
Does gthumb make thumbnails, ie images with smaller dimensions?

Png doesn't compress photos well. A common program "pngcrush" might shrink them a little. But if you want smaller filesizes, try jpg.
Does gthumb make thumbnails, ie images with smaller dimensions?

Png doesn't compress photos well. A common program "pngcrush" might shrink them a little. But if you want smaller filesizes, try jpg.
gthumb makes the converted png roughly the same size as the original cr2, and surprizingly the png creates is noticably different from the resulting png after using ImageMagick.

I have read that the png format does not compress as well as jpg, but my problem is not what format has the best compression, it is actually that the resulting converted png is 4-5 times larger than the already large cr2 original after conversion. However, I never did try just using ImageMagick to convert to jpgs to see what the result would be. I just always convert to png, so I guess I did not think of that.

I still have a stack of photos to convert, one by one is going slowly, so if anyone has any ideas, because it is very likely to be user error, I would appreciate hearing them.

cheers,
nap
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: cr2 to png problem

Post by snibgo »

Compression in jpeg and cr2 is optimised for photographs. Png compression is not optimised for photographs, so I would expect the file size to be larger.

You can compare the results from ImageMagick and gthumb:

Code: Select all

identify -verbose fromIm.png >fromIm.txt
identify -verbose fromGthumb.png >fromGthumb.txt
This should tell you why the compression is different. Post the results here, if you like, and we can try to explain them.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: cr2 to png problem

Post by fmw42 »

try adding -depth 8 to your command line if you are on Q16 IM; otherwise, if on Q16 you may be getting 16-bits per channel output rather than 8-bits per channel. That could double your filesize. (apart from the poor png compression)
Post Reply