PSD->TIFF conversion loses layer offsets.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
imagemagick (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I'm stitching TIFFs together with hugin and enblend. enblend relies on offset information created by hugin. Hugin creates multilayer TIFFs, which are edited in Gimp (if the layer masks need tweaking) and saved as multilayer PSDs (as Gimp cannot save multilayer TIFFs, see GNOME bug 335975). These PSDs have layer offset information:
$ identify beach.psd
beach.psd[0] PSD 6630x1906 DirectClass 73.2mb 50.590u 1:59
beach.psd[1] PSD 3052x1906 3052x1906+3578+0 DirectClass 73.2mb 49.860u 1:58
beach.psd[2] PSD 3146x1906 3146x1906+1533+0 DirectClass 73.2mb 49.520u 1:58
beach.psd[3] PSD 3027x1906 3027x1906+0+0 DirectClass 73.2mb 49.170u 1:57
Layer 0 is the entire canvas, presumably; this is a composite of three images.
The +x+y coordinates are what I'm interested in. enblend doesn't support stitching from multilayer images, so it can either use an image the size of the final canvas, or an image with offset information, as the layers here are interpreted.
The PSD was converted to TIFF:
$ convert -verbose -compress lzw beach.psd beach-tmp%d.tif
beach.psd[0] PSD 6630x1906 DirectClass 73.2mb 52.870u 1:12
beach.psd[0] PSD 3052x1906 3052x1906+3578+0 DirectClass 73.2mb 52.130u 1:11
beach.psd[0] PSD 3146x1906 3146x1906+1533+0 DirectClass 73.2mb 51.790u 1:11
beach.psd[0] PSD 3027x1906 3027x1906+0+0 DirectClass 73.2mb 51.430u 1:10
beach.psd PSD 6630x1906 DirectClass 73.2mb
beach.psd PSD 3052x1906 3052x1906+3578+0 DirectClass 73.2mb
beach.psd PSD 3146x1906 3146x1906+1533+0 DirectClass 73.2mb
beach.psd PSD 3027x1906 3027x1906+0+0 DirectClass 73.2mb
TIFF Directory at offset 0x0
Image Width: 6630 Image Length: 1906
Resolution: 72, 72 (unitless)
Bits/Sample: 1
Compression Scheme: LZW
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 9
Planar Configuration: single image plane
Photoshop Data: <present>, 14 bytes
Software: ImageMagick 6.2.3 01/24/06 Q16 http://
DocumentName: beach-tmp0.tif
beach.psd=
TIFF Directory at offset 0x0
Image Width: 3052 Image Length: 1906
Resolution: 72, 72 (unitless)
Bits/Sample: 8
Compression Scheme: LZW
Photometric Interpretation: RGB color
Extra Samples: 1<unassoc-alpha>
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 1
Planar Configuration: single image plane
Photoshop Data: <present>, 14 bytes
Software: ImageMagick 6.2.3 01/24/06 Q16 http://
DocumentName: beach-tmp1.tif
Predictor: horizontal differencing 2 (0x2)
beach.psd=
TIFF Directory at offset 0x0
Image Width: 3146 Image Length: 1906
Resolution: 72, 72 (unitless)
Bits/Sample: 8
Compression Scheme: LZW
Photometric Interpretation: RGB color
Extra Samples: 1<unassoc-alpha>
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 1
Planar Configuration: single image plane
Photoshop Data: <present>, 14 bytes
Software: ImageMagick 6.2.3 01/24/06 Q16 http://
DocumentName: beach-tmp2.tif
Predictor: horizontal differencing 2 (0x2)
beach.psd=
TIFF Directory at offset 0x0
Image Width: 3027 Image Length: 1906
Resolution: 72, 72 (unitless)
Bits/Sample: 8
Compression Scheme: LZW
Photometric Interpretation: RGB color
Extra Samples: 1<unassoc-alpha>
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 1
Planar Configuration: single image plane
Photoshop Data: <present>, 14 bytes
Software: ImageMagick 6.2.3 01/24/06 Q16 http://
DocumentName: beach-tmp3.tif
Predictor: horizontal differencing 2 (0x2)
beach.psd=
The resultant TIFFs have lost their offset information:
$ identify -verbose beach-tmp3.tif
beach-tmp3.tif TIFF 3027x1906 DirectClass 5.3mb 0.660u 0:01
And, of course, enblend identifies them as having no offset:
$ enblend -v beach-tmp{
Input image "beach-tmp1.tif" RGB UINT8 position=0x0 size=3052x1906
Input image "beach-tmp2.tif" RGB UINT8 position=0x0 size=3146x1906
Input image "beach-tmp3.tif" RGB UINT8 position=0x0 size=3027x1906
Output image size: (0, 0) -> (3146, 1906) = (3146 x 1906)
The current workaround is to expand each layer in Gimp to be the size of the entire canvas. This is monstrously space-inefficient, so I end up expanding, saving and deleting each layer in sequence.
Changed in imagemagick: | |
status: | Unconfirmed → Confirmed |
Forgot to add: I'm running Breezy Badger, imagemagick version 6:6.2.3. 4-1ubuntu1. 1.