Creating a Transparent PNG from a greyscale TIFF

i am calling an external program that returns me an 8-bit grey-scale TIFF. I want to use it as the alpha channel of a colored PNG. If I create the PNG, flood it with the color I want, load the TIFF, put it in my PNG’s mask with ApplyMask, then save, I get an image that looks correct in Photoshop. When I bring it back into my app, however, the transparency is gone.

Is there a recommended way to do this?

You could use Picture.Transparent = 1 if you just want to make white transparent.

http://documentation.xojo.com/index.php/Picture.Transparent

Warning: this (when it works *) will remove ALL white color.

I prefer to remove the white using GIMP (or PhotoShop, or): magic wand, click, delete key (fn-delete with GIMP) et voil.

Of course, if you have tons of files to do, a different solution have to be done.

Edit *: your white have to be white not like the one I had who was white to my eyes not for the computer :wink:

What platform? Also what options are you using when creating a PNG, I noticed that Sierra is a little more finicky with transparency than any other version of the macOS.

I routinely work with PSDs, TIFFs and PNGs (creation and such).

maybe your app doesn’t load the transparency properly?

Can you provide such a PNG here for testing?

it is not clear to me how to provide my png to the forum. how does that work?

Upload somewhere and than paste a link here.

If Photoshop shows it correctly I’d assume the png file is properly formed. Maybe it’s just bringing it into your app that’s the problem. What’s the code for this and how have you tested, or do you mean adding the png file in the navigator?

my image should be available at:

it is opaque in most areas, but partially transparent in others. i then load it back into my app with:

LocalPicture = Picture.Open( )

After I do, LocalPicture shows HasAlphaChannel as False.

I then output it using MBS dynapdf, so there are probably two places where I could be going wrong.

second attempt.

https://www.dropbox.com/s/dkvyk9ndbbqc4hz/White_Tailed_Deer_niche.png?dl=0

[code] dim f as FolderItem = SpecialFolder.Desktop.Child(“White_Tailed_Deer_niche.png”)
dim p as Picture = Picture.Open(f)

Backdrop = p[/code]

no problem loading here.
Shows fine with alpha.