Resizing PSD moves layers slightly?

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
anchsm
Posts: 2
Joined: 2019-07-08T18:12:24-07:00
Authentication code: 1152

Resizing PSD moves layers slightly?

Post by anchsm » 2019-07-08T18:27:13-07:00

I'm resizing some large psd files (e.g. 6320 x 2880, 20+ layers) and in the resulting images, lots of the layers are shifted by a few pixels. They're not all shifted by the same amount or the same direction either, so their relative positions to each other has changed (i.e. I can't just add some kind of global offset to shift them back):

magick src_image.psd -resize 50% dst_image.psd

Windows 10 Pro, ImageMagick 7.0.8-51 Q8 x64

anchsm
Posts: 2
Joined: 2019-07-08T18:12:24-07:00
Authentication code: 1152

Re: Resizing PSD moves layers slightly?

Post by anchsm » 2019-07-09T11:11:18-07:00

More on this. Looking at a single layer's data in the input and output images:

src_image.psd:

Code: Select all

		name	"door 2"
		uniname	L"door 2"
		width	547
		height	291
		top		111
		left	        5698
		bottom	402
		right	        6245
		opacity	255
		flags	        41
dst_image.psd (src_image.psd resized to 50%):

Code: Select all

		name	"door 2"
		uniname	L"door 2"
		width	274
		height	146
		top		56	
		left	        2854 (doubled is 5708 ...10 pixels off) 
		bottom	202
		right	        3128 (doubled is 6256 ...11 pixels off)
		opacity	255
		flags	        1 (0x28 are missing)

width, height, top, and bottom look fine (if doubled they're off by one pixel, but they're uints, so it's just rounding).
left and right are wrong though. There's a whole 10 pixel offset that's got into the horizontal somehow.
Also some of the bit flags have been removed. I tried both settings of -define psd:additional-info, but it makes no difference to that.

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

Re: Resizing PSD moves layers slightly?

Post by fmw42 » 2019-07-09T11:30:20-07:00

Upload your PSD file to some free hosting service that won't change the format and put the URL here so the developers can look at your image and see what might be happening. Note that Imagemagick currently has rather primitive PSD processing capabilities.

Post Reply