Page 1 of 1
Density will be parsed wrong by PS. Howto get it right w.IM?
Posted: 2014-02-14T14:36:05-07:00
by floogy
Hi, I got a strange issue simmilar or related to
http://www.wizards-toolkit.org/discours ... =1&t=16594, but upside down. I got a special 2D/3D-rendering software, which seems to interpret the density of images the same way as photoshop does.
I got 6 images, that I combine by montage to an image, that has 6 times the width as the 6 single images.
The first issue I had was, that montage of the current cygwin IM (6.7.3-3 q16 @32bit) strips the ICC profile. Therefore I'm running mogrify to fix that.
If I use -strip in montage and
Code: Select all
targetDens=150
exiftool ${progress} -P -m -overwrite_original -ICCProfileName="eciRGB v2" -Photoshop:All= -XMP:XResolution="$targetDens" -XMP:YResolution="$targetDens" -XMP:ResolutionUnit=inch -YResolution="$targetDens" -XResolution="$targetDens"
or
Code: Select all
IMscaleMogrify="-density ${targetDens}x${targetDens} -filter Lanczos -distort Resize ${TextureSize}+0+0!"
mogrify ${IMscaleMogrify} -compress ${Compressor} -profile "$OUTPUTPROFILE"
Photoshop still opens the image with 72dpi, and therefore with the wrong dimensions.
But all metadata photoshop shows with ctrl+alt+shift+i shows 150dpi (xmp and exif/tiff). Also imagemagick identify or exiftools are showing the right density of 150dpi, but photoshop and the 2D/3D software misinterpret it as 72dpi and therefore the wrong rendering and dimensions (mm or inch).
What can I do with tools like IM or exiftools?
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T14:44:24-07:00
by fmw42
What image format? What version of IM? What platform?
I recall someone mentioning that PS keeps density in a separate special tag. But cannot confirm that. Use Exiftool and see if there are special PS fields.
Can you post your image to some free hosting service such as dropbox (public folder) and provide a link here so others can check and test with it?
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T15:19:39-07:00
by floogy
Hello, thank you for your prompt answer Fred. First of all, I'm not a native speaker and therfore somewhat slow or not very clear.
I already told something about the Os and version of IM. PS version is 5.5. ImageMagick 6.7.6-3 2012-04-28 Q16 on Windows 7 cygwin 32bit. That's the current version in cygwin, unfortunately a bit outdated.
It's mime type image/tiff.
Here some output of such a file:
Code: Select all
$ exiftool -s -ee -g "some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif"
---- ExifTool ----
ExifToolVersion : 9.25
---- File ----
FileName : z1691_W23_file_name_mF_1S_150dpi.tif
Directory : some/folder/tif/z1691_W23_file_name_mF_1S
FileSize : 164 MB
FileModifyDate : 2014:02:14 21:17:19+00:00
FileAccessDate : 2014:02:14 21:18:01+00:00
FileCreateDate : 2014:02:14 21:16:58+00:00
FilePermissions : rw-rw-rw-
FileType : TIFF
MIMEType : image/tiff
ExifByteOrder : Little-endian (Intel, II)
---- EXIF ----
ImageWidth : 6168
ImageHeight : 7618
BitsPerSample : 8 8 8 8
Compression : LZW
PhotometricInterpretation : RGB
FillOrder : Normal
DocumentName : z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi.tif
StripOffsets : (Binary data 71277 bytes, use -b option to extract)
Orientation : Horizontal (normal)
SamplesPerPixel : 4
RowsPerStrip : 1
StripByteCounts : (Binary data 45707 bytes, use -b option to extract)
XResolution : 150
YResolution : 150
PlanarConfiguration : Chunky
ResolutionUnit : None
PageNumber : 0 1
Predictor : Horizontal differencing
WhitePoint : 0.3127000034 0.3289999962
PrimaryChromaticities : 0.6399999857 0.3300000131 0.3000000119 0.6000000238 0.150000006 0.05999999866
ExtraSamples : Unassociated Alpha
---- XMP ----
XMPToolkit : Image::ExifTool 9.25
ICCProfileName : eciRGB v2
ResolutionUnit : inches
XResolution : 150
YResolution : 150
---- ICC_Profile ----
ProfileCMMType : ADBE
ProfileVersion : 2.4.0
ProfileClass : Display Device Profile
ColorSpaceData : RGB
ProfileConnectionSpace : XYZ
ProfileDateTime : 2007:03:02 10:07:41
ProfileFileSignature : acsp
PrimaryPlatform : Unknown ()
CMMFlags : Not Embedded, Independent
DeviceManufacturer :
DeviceModel :
DeviceAttributes : Reflective, Glossy, Positive, Color
RenderingIntent : Perceptual
ConnectionSpaceIlluminant : 0.9642 1 0.82491
ProfileCreator : bICC
ProfileID : 9c6d34a5ada445f6146d98b0510c126d
ProfileCopyright : Copyright (C) 2007 by Color Solutions, All Rights Reserved. License details can be found on: http://www.eci.org/eci/en/eciRGB.php
ProfileDescription : eciRGB v2
MediaWhitePoint : 0.9642 1 0.82491
RedTRC : (Binary data 1412 bytes, use -b option to extract)
GreenTRC : (Binary data 1412 bytes, use -b option to extract)
BlueTRC : (Binary data 1412 bytes, use -b option to extract)
RedMatrixColumn : 0.65027 0.32028 0
GreenMatrixColumn : 0.17804 0.60205 0.06783
BlueMatrixColumn : 0.13588 0.07767 0.75708
---- Composite ----
ImageSize : 6168x7618
Code: Select all
$ identify -verbose "B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif"
Image: "B:\some\folder\\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif
Format: TIFF (Tagged Image File Format)
Class: DirectClass
Geometry: 6168x7618+0+0
Resolution: 150x150
Print size: 41.12x50.7867
Units: PixelsPerInch
Type: TrueColorMatte
Base type: TrueColor
Endianess: MSB
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 131.215 (0.514567)
standard deviation: 40.2768 (0.157948)
kurtosis: -0.0665014
skewness: -0.161387
Green:
min: 0 (0)
max: 255 (1)
mean: 126.314 (0.495348)
standard deviation: 39.9685 (0.156739)
kurtosis: -0.119985
skewness: -0.0906061
Blue:
min: 0 (0)
max: 255 (1)
mean: 114.798 (0.450188)
standard deviation: 41.0783 (0.161091)
kurtosis: -0.307741
skewness: -0.0357447
Alpha:
min: 255 (1)
max: 255 (1)
mean: 255 (1)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 93.0815 (0.365026)
standard deviation: 35.0254 (0.137355)
kurtosis: 18.3092
skewness: -1.55993
Rendering intent: Perceptual
Gamma: 0.45455
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Interlace: None
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Compose: Over
Page geometry: 6168x7618+0+0
Dispose: Undefined
Iterations: 0
Compression: LZW
Orientation: TopLeft
Properties:
date:create: 2014-02-14T21:18:00+01:00
date:modify: 2014-02-14T21:17:19+01:00
photoshop:ICCProfile: eciRGB v2
signature: fffd0198f6de3eab17c85b2f8d0d1910052dc22e483246d57c1e311c4c289651
tiff:alpha: unassociated
tiff:document: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi.tif
tiff:endian: lsb
tiff:photometric: RGB
tiff:rows-per-strip: 1
tiff:XResolution: 150/1
tiff:YResolution: 150/1
Profiles:
Profile-icc: 1992 bytes
Description: eciRGB v2
Manufacturer: eciRGB v2
Model: eciRGB v2
Copyright: Copyright (C) 2007 by Color Solutions, All Rights Reserved. License details can be found on: http://www.eci.org/eci/en/eciRGB.php
Profile-xmp: 3055 bytes
Artifacts:
filename: B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif
verbose: true
Tainted: False
Filesize: 171.9MB
Number pixels: 46.99M
Pixels per second: 6.462MB
User time: 2.824u
Elapsed time: 0:08.271
Version: ImageMagick 6.7.6-3 2012-04-28 Q16 http://www.imagemagick.org
150dpi_IM_but_72dpi_PS.png
http://ubuntuone.com/3VOUThZbX1CH0duqyLyxeT
crtl+i_150dpi_IM_but_72dpi_PS.png
http://ubuntuone.com/6ufskH6TgCSAAXYJhFkfH5
z1697_W52_some_other_mF_1S_150dpi.tif [huge >130MiB]
http://ubuntuone.com/7cTH69AzGYKtYDs24BBOwp
___
72dpi_IM_but_150dpi_PS.png
http://ubuntuone.com/2B8PsltD2jdqFK5YGKntxx
crtl+i_72dpi_IM_but_150dpi_PS.png
http://ubuntuone.com/5mn21vHTpghY6fUHWvimsY
z1697_W52_some_other_mF_1S_SEG.jpg
http://ubuntuone.com/5DfFA04t8onnZIVyeQBSwY
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T15:27:20-07:00
by fmw42
Your image shows 150 density in both IM fields and tiff fields. So it should work. What do you get when you convert your tiff to another tiff in IM for the verbose information. Does that change the compression or density or units? What happens if you use mogrify as well. What does the verbose information show. I am just trying to find out where if any where the processing is changing your data.
convert image.tiff newimage.tiff
It might be best if you can post your image to some free hosting service such as dropbox (public folder) and post a link here to it. Then other can test with it. It could be that there was a bug in your version of IM that my now work properly on a current version of IM. IM 6.7.6.3 is rather old (120 versions old).
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T15:49:15-07:00
by floogy
I uploaded the images (png are screenshots of photoshop crtl+i and crtl+alt+shift+i meta info) and the 2MiB jpeg (72dpi in IM) and the 130MiB TIFF image (150 dpi in IM). I edited my last post. You may find the downloads there.
Do you know of a current version, packaged for cygwin?
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T15:55:53-07:00
by fmw42
Please clarify. What are the JPG and Tiff images? Is one an input and the other an output? If so what was the command you used. The tiff is rather large. Do you have any other smaller example that shows the issue. More information would be helpful to understand what your images represent and how they were created.
Did you run the test I asked to convert the input tiff to another output tiff?
Are you converting from tiff to jpg?
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T16:08:44-07:00
by fmw42
My guess without further examination is that -strip is removing the tiff: density and PS needs that to read the correct density.
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T16:11:37-07:00
by floogy
I tried to use -strip to get around that issue.
I think montage or mogrify introduced the issue.
I needed to use mogrify to readd the lost icc profile. montage stripped that.
Here is the diff of the two images, source and target of convert source target_next:
Code: Select all
$ diff <(identify -verbose z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi.tif) <(identify -verbose z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi_next.tif)
1c1
< Image: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi.tif
---
> Image: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi_next.tif
74,75c74,75
< date:create: 2014-02-14T21:18:00+01:00
< date:modify: 2014-02-14T21:17:19+01:00
---
> date:create: 2014-02-14T23:58:54+01:00
> date:modify: 2014-02-14T23:58:54+01:00
79c79
< tiff:document: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi.tif
---
> tiff:document: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi_next.tif
93c93
< filename: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi.tif
---
> filename: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi_next.tif
98,100c98,100
< Pixels per second: 4.74MB
< User time: 3.120u
< Elapsed time: 0:10.914
---
> Pixels per second: 4.625MB
> User time: 2.839u
> Elapsed time: 0:11.160
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T16:19:42-07:00
by floogy
Ah cool! Strange enough, but that solved the issue! Also if there is no diff! PS opens the target_next.tif as 150dpi!
So I have to use convert over mogrify to readd the icc profile to the stripped montage tiff. I'll try that.
Hm, that doesn't work. I think I have to strip it from psd xmp tags first and set all other tags to density 150. After that I should convert it in a simple way without options and I may get a result consistent in the kind it will be parsed by im or ps regarding the density.
I have to make further tests.
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T17:09:24-07:00
by fmw42
If you use -strip and it removes the tiff: density, then I do not know that IM can put it back. Perhaps you need to avoid the strip and use other methods to combine your images such as convert ... -append.
The link to your tiff file does not work, so I cannot even download it to try.
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T17:26:21-07:00
by floogy
I did remove it. Thank you for the hint with append and the use of -strip. I'm currently testing. I'll report. Maybe I'll offer other images next week. I'll report if I make some progress with my efforts.
I made some progress: if I use -strip in montage and convert instead of mogrify with -density 150x150 and exiftool to strip the PS xmp metadata and set the xmp resolutions and resolutionunits and converting then a last time without any options, I then get a density of 150 with PS crlt+i too.
Bizarre again: Now it gets parsed in Ps right as 150dpi, but not yet in that special software, but a jpeg I produced by convert is working well.
Here the identify -verbose output of the PS ok but for my task it does not yet suffice:
Code: Select all
$ identify -verbose "B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif"
Image: B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif
Format: TIFF (Tagged Image File Format)
Class: DirectClass
Geometry: 6168x7618+0+0
Resolution: 150x150
Print size: 41.12x50.7867
Units: PixelsPerInch
Type: TrueColorMatte
Base type: TrueColor
Endianess: MSB
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 131.215 (0.514567)
standard deviation: 40.2768 (0.157948)
kurtosis: -0.0665014
skewness: -0.161387
Green:
min: 0 (0)
max: 255 (1)
mean: 126.314 (0.495348)
standard deviation: 39.9685 (0.156739)
kurtosis: -0.119985
skewness: -0.0906061
Blue:
min: 0 (0)
max: 255 (1)
mean: 114.798 (0.450188)
standard deviation: 41.0783 (0.161091)
kurtosis: -0.307741
skewness: -0.0357447
Alpha:
min: 255 (1)
max: 255 (1)
mean: 255 (1)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 93.0815 (0.365026)
standard deviation: 35.0254 (0.137355)
kurtosis: 18.3092
skewness: -1.55993
Rendering intent: Perceptual
Gamma: 0.45455
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Interlace: None
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Compose: Over
Page geometry: 6168x7618+0+0
Dispose: Undefined
Iterations: 0
Compression: LZW
Orientation: TopLeft
Properties:
date:create: 2014-02-15T01:33:55+01:00
date:modify: 2014-02-15T01:33:55+01:00
photoshop:ICCProfile: eciRGB v2
signature: fffd0198f6de3eab17c85b2f8d0d1910052dc22e483246d57c1e311c4c289651
tiff:alpha: unassociated
tiff:document: z1691_W23_file_name_mF_1S/z1691_W23_file_name_mF_1S_150dpi.tif
tiff:endian: lsb
tiff:photometric: RGB
tiff:rows-per-strip: 1
tiff:XResolution: 150/1
tiff:YResolution: 150/1
Profiles:
Profile-icc: 1992 bytes
Description: eciRGB v2
Manufacturer: eciRGB v2
Model: eciRGB v2
Copyright: Copyright (C) 2007 by Color Solutions, All Rights Reserved. License details can be found on: http://www.eci.org/eci/en/eciRGB.php
Profile-xmp: 3055 bytes
Artifacts:
filename: B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif
verbose: true
Tainted: False
Filesize: 171.9MB
Number pixels: 46.99M
Pixels per second: 5.043MB
User time: 3.089u
Elapsed time: 0:10.318
Version: ImageMagick 6.7.6-3 2012-04-28 Q16 http://www.imagemagick.org
tif in PS ok, but with poor rendering due to 72dpi parsing (or alpha?)
http://ubuntuone.com/42AyEuzKmT96uCWL79JqR6
jpg ok
http://ubuntuone.com/2NMve7HElUEQHDWjWvPo2P
This is the same file saved from PS with 'flattening, reduced to one background layer', which appears to be due to the presence of either a layer or an alpha chanel? Anyway, it will not render well, even if it's saved by PS.
Code: Select all
$ identify -verbose "B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif"
Image: B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif
Format: TIFF (Tagged Image File Format)
Class: DirectClass
Geometry: 6168x7618+0+0
Resolution: 150x150
Print size: 41.12x50.7867
Units: PixelsPerInch
Type: TrueColor
Base type: TrueColor
Endianess: MSB
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 131.215 (0.514567)
standard deviation: 40.2768 (0.157948)
kurtosis: -0.0665014
skewness: -0.161387
Green:
min: 0 (0)
max: 255 (1)
mean: 126.314 (0.495348)
standard deviation: 39.9685 (0.156739)
kurtosis: -0.119985
skewness: -0.0906061
Blue:
min: 0 (0)
max: 255 (1)
mean: 114.798 (0.450188)
standard deviation: 41.0783 (0.161091)
kurtosis: -0.307741
skewness: -0.0357447
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 124.109 (0.486701)
standard deviation: 40.4439 (0.158604)
kurtosis: -0.0220643
skewness: -0.106972
Rendering intent: Perceptual
Gamma: 0.45455
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Interlace: None
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Compose: Over
Page geometry: 6168x7618+0+0
Dispose: Undefined
Iterations: 0
Compression: LZW
Orientation: TopLeft
Properties:
date:create: 2014-02-15T02:14:50+01:00
date:modify: 2014-02-15T02:14:50+01:00
dc:format: image/tiff
exif:PixelXDimension: 6168
exif:PixelYDimension: 7618
photoshop:ColorMode: 3
photoshop:ICCProfile: eciRGB v2
signature: 06ef461f4182cdada9c19e6ff5ef6498f5e52a93b0f6a7f6c33f17cddbaad173
tiff:endian: lsb
tiff:photometric: RGB
tiff:rows-per-strip: 14
tiff:software: Adobe Photoshop CS5.1 Windows
tiff:timestamp: 2014:02:15 02:14:11
xmp:CreateDate: 2014-02-15T01:33:28+01:00
xmp:MetadataDate: 2014-02-15T02:14:11+01:00
xmp:ModifyDate: 2014-02-15T02:14:11+01:00
xmpMM:DocumentID: xmp.did:3EA60AD2DD95E31185E0D6AAF39428D3
xmpMM:InstanceID: xmp.iid:3EA60AD2DD95E31185E0D6AAF39428D3
xmpMM:OriginalDocumentID: xmp.did:3EA60AD2DD95E31185E0D6AAF39428D3
Profiles:
Profile-8bim: 7172 bytes
Profile-icc: 1992 bytes
Description: eciRGB v2
Manufacturer: eciRGB v2
Model: eciRGB v2
Copyright: Copyright (C) 2007 by Color Solutions, All Rights Reserved. License details can be found on: http://www.eci.org/eci/en/eciRGB.php
Profile-xmp: 14058 bytes
Artifacts:
filename: B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif
verbose: true
Tainted: False
Filesize: 157.1MB
Number pixels: 46.99M
Pixels per second: 7.816MB
User time: 2.075u
Elapsed time: 0:07.012
Version: ImageMagick 6.7.6-3 2012-04-28 Q16 http://www.imagemagick.org
identify: B:\some\folder\tif\z1691_W23_file_name_mF_1S\z1691_W23_file_name_mF_1S_150dpi.tif: wrong data type 7 for "RichTIFFIPTC"; tag ignored. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/768.
But my next Test will be with -alpha off
Re: Density will be parsed wrong by PS. Howto get it right w
Posted: 2014-02-14T20:19:14-07:00
by floogy
It seems, that the bizarre behaviour of the special image application happened due to a memory overflow or something similar. It simply showed the last result instead of a new rendering. This is a bug in that program. I restarted that application, and it rendered that image well. So I guess it was due to the alpha channel.