resolution problem
-
- Posts: 10
- Joined: 2009-06-30T23:14:10-07:00
- Authentication code: 8675309
resolution problem
Hi All,
I have a requirement to convert set of tif images to jpeg format. For this purpose I have written a perl script. Through which I called image magick successfully. At the conversion stage 300x300 dpi resolution need to be changed to 150x150 resolution.
I have used -resample command for this purpose. Imagemagick shows the converted file correctly. But Windows image viewers and photoshop shows only the original resolution of the tif image.
I have read about the problem in imagemagick Documentation, it clearly explains that:
"Note that Photoshop stores and obtains image resolution from a proprietary embedded profile. If this profile exists in the image, then Photoshop will continue to treat the image using its former resolution, ignoring the image resolution specified in the standard file header."
How can I remove the proprietary embedded profile and make all the windows image viewers and photoshop to show the correct dpi?
Thanks in advance,
Srikrishnan
I have a requirement to convert set of tif images to jpeg format. For this purpose I have written a perl script. Through which I called image magick successfully. At the conversion stage 300x300 dpi resolution need to be changed to 150x150 resolution.
I have used -resample command for this purpose. Imagemagick shows the converted file correctly. But Windows image viewers and photoshop shows only the original resolution of the tif image.
I have read about the problem in imagemagick Documentation, it clearly explains that:
"Note that Photoshop stores and obtains image resolution from a proprietary embedded profile. If this profile exists in the image, then Photoshop will continue to treat the image using its former resolution, ignoring the image resolution specified in the standard file header."
How can I remove the proprietary embedded profile and make all the windows image viewers and photoshop to show the correct dpi?
Thanks in advance,
Srikrishnan
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: resolution problem
I am not sure about this, but try using -strip after reading in the image.
see http://www.imagemagick.org/script/comma ... k4e2#strip
see http://www.imagemagick.org/script/comma ... k4e2#strip
-
- Posts: 10
- Joined: 2009-06-30T23:14:10-07:00
- Authentication code: 8675309
Re: resolution problem
Thanks for your suggestion,
I have tried the option "-strip" it reduces the 125KB file to 65KB, but even original resolution not shown by the "Windows Pictures and Fax Viewer" or any other windows softwares.
my syntax is as follows:
convert c:/sample.jpg -strip c:/sample.jpg
thanks,
Srikrishnan
I have tried the option "-strip" it reduces the 125KB file to 65KB, but even original resolution not shown by the "Windows Pictures and Fax Viewer" or any other windows softwares.
my syntax is as follows:
convert c:/sample.jpg -strip c:/sample.jpg
thanks,
Srikrishnan
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: resolution problem
IM is changing the quality factor when you go from jpg to jpg. if it cannot determine the quality factor it uses a default of 92. Furthermore, it is not a good idea to go from jpg to jpeg as IM will decompress and recompress the image which will cause extra loss of quality as jpeg is not a loss-less compression. You can force the compression to higher or lower values using -quality. If you want a smaller file size, then use a smaller compression.
see
http://www.imagemagick.org/script/comma ... p4#quality
see
http://www.imagemagick.org/script/comma ... p4#quality
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: resolution problem
More than likely it is a separate 'resolution' setting from the images normal default. Photoshop especially likes to use its own resolution setting over and able the images normal resolution, that IM sets.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 10
- Joined: 2009-06-30T23:14:10-07:00
- Authentication code: 8675309
Re: resolution problem
Thanks for everyone,
now I have used the option "-strip" as follows:
convert -strip -density 150 -quality 80 "c:/sample.tif" +antialias -colorspace RGB "c:/sample.jpg"
it removes the embedded profile of photoshop and all the viewers shows exactly as per our requirement.
Thanks,
Srirkishnan
now I have used the option "-strip" as follows:
convert -strip -density 150 -quality 80 "c:/sample.tif" +antialias -colorspace RGB "c:/sample.jpg"
it removes the embedded profile of photoshop and all the viewers shows exactly as per our requirement.
Thanks,
Srirkishnan
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: resolution problem
The +antialias is not needed. You don't make use of the setting.
Also the -strip should be placed after the image read (when you have an image in memory to strip.
Also the -strip should be placed after the image read (when you have an image in memory to strip.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 10
- Joined: 2009-06-30T23:14:10-07:00
- Authentication code: 8675309
Re: resolution problem
Hi Anthony,
thanks for your mail.
But in my case, as per i mentioned in my previous mail, if I use "-strip" after the image read, it will not stripped out the profile.
Thanks,
Srikrishnan
thanks for your mail.
But in my case, as per i mentioned in my previous mail, if I use "-strip" after the image read, it will not stripped out the profile.
Thanks,
Srikrishnan
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: resolution problem
That seems strange to me!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: resolution problem
Was -strip change not too long ago to leave the profiles. I seem to recall something about that, though not completely sure. So perhaps one needs -strip +profile after reading the image.
Re: resolution problem
For photoshop to respect the density set by imagemagick, we use the
option+profile "8bim"
Code: Select all
convert -units PixelsPerInch input.tif +profile "8bim" -density 150 output.jpg