Page 1 of 1
Some converted jpg from tiff files don't show in browser
Posted: 2007-09-05T10:19:50-07:00
by jasonmmiller
I'm rather new with ImageMagick and have been tasked with converting 700 TIFF images to jpg, no problem right?!
Most of them are fine, but a select few (around 25) do not show up either IE or Mozilla, even though they open up fine in every graphics program. Has anyone see this before?
I did note that the problem TIFFs are all 32 Bit color, 300x300 dpi, while all the ones that worked are only 8 bit. I tried to use the "-depth 8" to change it on the fly but that didn't work either.
Thanks for any help you can provide!
Re: Some converted jpg from tiff files don't show in browser
Posted: 2007-09-05T20:29:24-07:00
by anthony
What command did you try that failed?
Re: Some converted jpg from tiff files don't show in browser
Posted: 2007-09-06T04:48:22-07:00
by jasonmmiller
convert -quality 75 -resample 72x72 -depth 8 -geometry 230 -compress JPEG "...6HD719.tif" "...6HD719.jpg"
I tried it with and without -quality, -resample, -depth, and -geometry in efforts to avoid any issues. I also tried just tiff to tiff to reduce the depth to 8-bit which didn't work either. It did however reduce the dpi as instructed, it just didn't reduce the depth from 32-bit.
Re: Some converted jpg from tiff files don't show in browser
Posted: 2007-09-06T05:35:11-07:00
by brendan
I don't think you need the -compress option, though that may not be the source of your woes.
Do the final jpg images otherwise display properly in other software?
When you compare the results of identify -verbose for the two types of tiff, what does it say about the compression?
Re: Some converted jpg from tiff files don't show in browser
Posted: 2007-09-06T06:09:19-07:00
by jasonmmiller
The compression is the same. Here are the significant differences:
Good:
Type: Grayscale
Colorspace: Gray
Gray: 8-bit
Channel depth:
Compression: ColorBurn
Tiff:rows-per-strip: 12
Bad:
Type: ColorSeparation
Colorspace: CMYK
Channel depth:
Cyan: 1-bit
Magenta: 1-bit
Yellow: 1-bit
Black: 8-bit
Compression: ColorBurn
Tiff:rows-per-strip: 2
Could it be that these images aren't grayscale? This seems to be another common thread...
Re: Some converted jpg from tiff files don't show in browser
Posted: 2007-09-06T06:30:11-07:00
by brendan
Do the bad jpgs display in applications other than a web-browser? For example, WindowsXP image preview or ImageMagick display?
Perhaps you should manually specify the colorspace (shot in the dark...):
Code: Select all
convert -colorspace CMYK -quality 75 -resample 72x72 -depth 8 -geometry 230 "...6HD719.tif" "...6HD719.jpg"
Re: Some converted jpg from tiff files don't show in browser
Posted: 2007-09-06T07:56:03-07:00
by jasonmmiller
Sorry I forgot to address that again. Yes, they do open up fine in every graphics package.
Excellent. Your suggestion led me to look at the -colorspace option which requires the use of the -colors option. -colors set the preferred number of colors, and since I only need a grayscale image I went with 256 and RGB for the -colorspace, and the image displays perfectly.
I tried a few more with [borat]great success[/borat]!
Thanks much, I'm very grateful!
Re: Some converted jpg from tiff files don't show in browser
Posted: 2007-09-06T20:27:02-07:00
by anthony
I also suggest you do your operations in the right order, otherwise IM has to make a guess. See Basics Page in IM examples.