Convert Transparent TIF to Transparent PNG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Transparent TIF to Transparent PNG

Post by snibgo »

It seems to me that the retouching staff could be given more explicit instructions about what they should produce.

Looking at FuzzyCoat.tif, I note that Microsoft Photo Viewer shows a transparent coat against a white background, while Gimp shows a black coat with a clip path. A plain IM conversion shows the same as MS Photo Viewer, but ...

Code: Select all

convert FuzzyCoat.tif -channel A -negate f.png
... gives a good result -- the detailed coat against a transparent background. This ignores the clip path entirely.

So this suggests another approach that copes with your retouching staff doing their work in a random fashion. For each input file, create a load of outputs, each using a variety of random tools, eg:

Code: Select all

convert in.png 
  ( +clone -write x0.png +delete )
  ( +clone -channel A -negate -write x1.png +delete )
  ( +clone -clip -alpha transparent +clip -channel A -negate -write x2.png +delete )
  NULL:
Then a script can examine x0.png, x1.png etc to determine which one is best. The ideal image probably doesn't have many pure white or black pixels.
snibgo's IM pages: im.snibgo.com
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert Transparent TIF to Transparent PNG

Post by Bonzo »

Looking at the file in photoshop there are a lot of layers and I tried snibgo's code after saving from photoshop - it automatically opened in photoshop after download rather than saving and I do not know why!
It looks like the code works OK and as snibgo said there needs to be a certain format/system the retouchers should use.
Image
annieidson
Posts: 7
Joined: 2014-03-11T09:39:18-07:00
Authentication code: 6789

Re: Convert Transparent TIF to Transparent PNG

Post by annieidson »

Thanks All,

I've forwarded this along to our system developer. Bonzo, would it be possible for you to post the png you produced so I can examine it in Photoshop (Mac OSX 10.8.5, Photoshop CS6)?

And while it's all well and good to talk about revising our retouching procedures (and that may well be something we need to address) even if we implemented a change today, that won't help the existing 725,000+ images I have in our catalogs. We reuse files for color variants and even if we only use 5-10% of those existing images, that's still a pretty daunting and expensive number to revise.

Again, thank you for all your help.

Best,

Ann
Post Reply