-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIFF/layered file formats support #2395
Comments
This was/is a tad optimistic on my part. Some problems to think over/deal with:
¹ most unfortunately, and stupidly, a Photoshop default; also it’s not trivial to tell them apart, but I think there is a way [see next comment for an idea] ² non-simple layers (eg. adjustment layers) cannot be correctly merged using ImageMagick (or whatever really, like eg. libvips), we may be able to tell if the TIFF contains those problematic layers via Exiftool or even metadata-extrator itself, though, and disable support only for them [see here for an explanation of why this is hard, verging on impossible] |
[EDIT: for updated logic look waaay down to the last comment] As a lot of the outstanding issues depend on improved transparency detection, here is my current understanding on how to be most robust (will help sort out cases described in the previous comment). We should use IM’s To correctly sense transparency for layered files, we need to look past that, though. If the count is >1, we could record a new property So:
We have two options: Phew! I hope it makes sense. (Does it, though?) |
TL;DR we may just disallow uploading pics with fancy layers when trasparency is not present in the composite, otherwise, this gets crazier… TBH, Adobe’s fault (case of Looking at ² above, there may not be an easy way of making sure the file contains only the simple layers that ImageMagick would be able to merge correctly. Neither Exiftool, nor metadata-extractor contain readily useful info here as far as I can see (or rather: Adobe doesn’t provide it). One would need to dump all Photoshop metadata via Exiftool and grep for the presence of any of those tags, then, any of layer effects and, probably, more. Here is a part of results for
Notice |
Save transparency option is recorded in metadata. Exiftool:
|
Just in case we would want to support PSDs too (should be easy after sorting out the above). Maximise compatibility option ensures a merged result is saved to the first |
Sadly, this
[EDIT] From my huge testing corpus of one file saved three times, it looks like the presence of |
Loose Alpha channels (which Photoshop should, I think, mark as Because we are only ever using a merged layer ( |
[EDIT: merging respects layer visibility, phew!] |
This issue is a (very) loose checklist for TIFF image support. Feel free to add/modify/delete/flush down the drain.
identify -format '%[opaque]'
to be able to properly support layered files (see TIFF/layered file formats support #2395 (comment))As some of the above operations are currently format-specific, adding TIFF provides a good opportunity to generalise them and bring some order to the galaxy. Viewing with an untrained eye, adding TIFF should be an order of magnitude easier than adding already supported PNG.
The text was updated successfully, but these errors were encountered: