Issue with .psd files and -dissolve operator

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
jimc99999
Posts: 21
Joined: 2009-01-29T08:44:41-07:00

Issue with .psd files and -dissolve operator

Post by jimc99999 »

I was attempting to use the dissolve operator to do color watermarking and ran into an issue because my watermark image is a .psd file, apparently with 2 layers. If I run the command:

convert crest.psd crest.png

I get 2 files:

crest-0.png
crest-1.png

As far as I can tell, these files are identical. I don't have photoshop, to see if this image has layers myself. This crest.psd image is composited onto another image with no problems, the alpha component is handled correctly and everything looks good. But when I use the .psd file with the -dissolve operator, it doesn't work correctly.

composite -dissolve 20,100 crest-0.png bg.jpg dissolve_png_20.jpg

yields the image dissolved correctly on the green bg.jpg:
Image

composite -dissolve 20,100 crest.psd bg.jpg dissolve_psd_20.jpg

yields the image incorrectly dissolved over the green background image:
Image

Any ideas, besides telling the users to convert all their .psd files to .png files?

Jim
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue with .psd files and -dissolve operator

Post by fmw42 »

usually the first layer of the psd file is the image composed from merging all the layers, so just use it as image.psd[0]
rather than image.psd
jimc99999
Posts: 21
Joined: 2009-01-29T08:44:41-07:00

Re: Issue with .psd files and -dissolve operator

Post by jimc99999 »

fmw42 wrote:usually the first layer of the psd file is the image composed from merging all the layers, so just use it as image.psd[0]
rather than image.psd
composite -dissolve 20,100 crest.psd[0] bg.jpg dissolve_psd_20.jpg

gives an error "composite: No match."

I originally ran into this problem in a ruby script using rmagick, where I get the same results as the commands I posted earlier. Using rmagick I am getting the first image when I open the file. That image works fine for an overlay composite, but not for watermark and dissolve.

Jim
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue with .psd files and -dissolve operator

Post by fmw42 »

you should not be getting an error unless your psd file is corrupt. what do you get from identify -verbose on your psd file?

what version of IM are you using? if old, perhaps upgrade

Note you can now do

convert ... -compose disssolve -composite

see -compose http://www.imagemagick.org/script/comma ... hp#compose
jimc99999
Posts: 21
Joined: 2009-01-29T08:44:41-07:00

Re: Issue with .psd files and -dissolve operator

Post by jimc99999 »

fmw42 wrote:you should not be getting an error unless your psd file is corrupt. what do you get from identify -verbose on your psd file?

Code: Select all

% identify -verbose crest.psd
Image: crest.psd
  Format: PSD (Adobe Photoshop bitmap)
  Class: DirectClass
  Geometry: 2032x2561+0+0
  Resolution: 600x600
  Print size: 3.38667x4.26833
  Units: PixelsPerInch
  Type: TrueColorMatte
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 8-bit
  Channel statistics:
    red:
      min: 0 (0)
      max: 255 (1)
      mean: 188.674 (0.739897)
      standard deviation: 98.0694 (0.384586)
      kurtosis: -0.578719
      skewness: -1.08066
    green:
      min: 0 (0)
      max: 255 (1)
      mean: 165.214 (0.647897)
      standard deviation: 109.013 (0.427502)
      kurtosis: -1.47694
      skewness: -0.561122
    blue:
      min: 0 (0)
      max: 255 (1)
      mean: 161.469 (0.633211)
      standard deviation: 109.291 (0.428591)
      kurtosis: -1.7224
      skewness: -0.397386
    alpha:
      min: 0 (0)
      max: 255 (1)
      mean: 112.413 (0.440835)
      standard deviation: 126.602 (0.496478)
      kurtosis: -1.94318
      skewness: -0.238319
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 164.486 (0.645043)
      standard deviation: 112.415 (0.440842)
      kurtosis: -1.55684
      skewness: -0.56001
  Alpha: rgba(255,255,255,0)   #FFFFFF00
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Page geometry: 2032x2561+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 0 of 2
  Compression: Undefined
  Orientation: TopLeft
  Properties:
    create-date: 2009-06-26T11:59:26-04:00
    dc:format: application/vnd.adobe.photoshop
    exif:ColorSpace: 4294967295
    exif:PixelXDimension: 2032
    exif:PixelYDimension: 2561
    modify-date: 2006-01-14T07:19:45-05:00
    photoshop:History: 
    signature: 108880dfea943376aa2fd25531cfb49db18a518bcfd1cf15de9bbf24c19849be
    xap:CreateDate: 2006-01-14T10:16:21-05:00
    xap:CreatorTool: Adobe Photoshop CS Macintosh
    xap:MetadataDate: 2006-01-14T10:16:21-05:00
    xap:ModifyDate: 2006-01-14T10:16:21-05:00
    xapMM:DocumentID: adobe:docid:photoshop:252546ad-8506-11da-9029-af10d2dac242
  Profiles:
    Profile-8bim: 23068 bytes
    Profile-exif: 302 bytes
    Profile-xmp: 6143 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 6.325mb
  Number pixels: 4.963mb
  Pixels per second: 423kb
  User time: 12.600u
  Elapsed time: 0:13
  Version: ImageMagick 6.5.3-10 2009-06-25 Q8 http://www.imagemagick.org
Image: crest.psd
  Format: PSD (Adobe Photoshop bitmap)
  Class: DirectClass
  Geometry: 2031x2561+0+0
  Resolution: 600x600
  Print size: 3.385x4.26833
  Units: PixelsPerInch
  Type: TrueColorMatte
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 8-bit
  Channel statistics:
    red:
      min: 0 (0)
      max: 255 (1)
      mean: 188.636 (0.73975)
      standard deviation: 98.0871 (0.384655)
      kurtosis: -0.580564
      skewness: -1.07984
    green:
      min: 0 (0)
      max: 255 (1)
      mean: 165.165 (0.647705)
      standard deviation: 109.025 (0.427549)
      kurtosis: -1.4779
      skewness: -0.560262
    blue:
      min: 0 (0)
      max: 255 (1)
      mean: 161.417 (0.633009)
      standard deviation: 109.301 (0.428632)
      kurtosis: -1.7231
      skewness: -0.396483
    alpha:
      min: 0 (0)
      max: 255 (1)
      mean: 112.468 (0.441052)
      standard deviation: 126.609 (0.496504)
      kurtosis: -1.9436
      skewness: -0.237432
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 164.437 (0.644853)
      standard deviation: 112.427 (0.440889)
      kurtosis: -1.5578
      skewness: -0.559156
  Alpha: rgba(255,255,255,0)   #FFFFFF00
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Page geometry: 2031x2561+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 1 of 2
  Compression: Undefined
  Orientation: TopLeft
  Properties:
    create-date: 2009-06-26T11:59:26-04:00
    dc:format: application/vnd.adobe.photoshop
    exif:ColorSpace: 4294967295
    exif:PixelXDimension: 2032
    exif:PixelYDimension: 2561
    label: Layer 2
    modify-date: 2006-01-14T07:19:45-05:00
    photoshop:History: 
    signature: 56734b8d936c166885cddf3cd2be1bf90204e30f50bf3852f0bf380ceb08f338
    xap:CreateDate: 2006-01-14T10:16:21-05:00
    xap:CreatorTool: Adobe Photoshop CS Macintosh
    xap:ModifyDate: 2006-01-14T10:16:21-05:00
  Profiles:
    Profile-8bim: 23068 bytes
    Profile-exif: 302 bytes
    Profile-xmp: 6143 bytes
  Artifacts:
    layer-opacity: 0
    layer-xpos: 0
    layer-ypos: 0
    verbose: true
  Tainted: False
  Filesize: 6.325mb
  Number pixels: 4.96mb
  Pixels per second: 363kb
  User time: 13.910u
  Elapsed time: 0:15
  Version: ImageMagick 6.5.3-10 2009-06-25 Q8 http://www.imagemagick.org
jimc99999
Posts: 21
Joined: 2009-01-29T08:44:41-07:00

Re: Issue with .psd files and -dissolve operator

Post by jimc99999 »

To update, other .psd files from that client do work fine with watermark and dissolve. Apparently something with this specific image is causing this problem.

Jim
Post Reply