ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Transparent TIFF (again...)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
dwilbourn Posted - Mar 01 2024 : 05:20:24
About 18 months ago we discussed transparent TIFFs and you provided a solution that (it seems) worked at the time. However I am no longer able to make transparent TIFFs with the code sample you gave then. Has something changed in the relevant code or am I just being stupid as usual?

(see https://www.imageen.com/ieforum/topic.asp?TOPIC_ID=5501 for the original)
7   L A T E S T    R E P L I E S    (Newest First)
dwilbourn Posted - Mar 04 2024 : 03:00:39
No, just customers that say "I need transparent TIFFs!"
xequte Posted - Mar 03 2024 : 20:32:06
It does not surprise me that most applications do not support transparent TIFF, as very few developers would be aware that TIFF even is able to support transparency. Are you aware of any image viewers that support other transparent TIFF files, but not ones created in ImageEn?



Nigel
Xequte Software
www.imageen.com
dwilbourn Posted - Mar 03 2024 : 20:11:34
.... tested both your Alpha image and a number on images I created using the suggested code. They do open with transparency in Paint.net and FastStone Image viewer but those are the only programs or viewers I can find that do. All the rest (3 programs and at least 3 online viewers) just reject them as invalid files. I also validated the files using exiftool and they pass that so it would appear they are valid it's just that very few programs support transparency. Certainly none of the mainstream image programs I use do!

Looks like I need to put a *lot* of comments in my code to stop bothering you again about this!
dwilbourn Posted - Mar 03 2024 : 18:59:52
Try again....

attach/dwilbourn/202433185937_example1.zip
85.64 KB
xequte Posted - Mar 03 2024 : 16:05:07
Hi

Nothing was attached.

Here is an example I created with the code above. It works correctly in the apps I test it with (Windows Photos, Paint.net, etc).

attach/xequte/20243316447_Alpha.TIFF

Nigel
Xequte Software
www.imageen.com
dwilbourn Posted - Mar 03 2024 : 10:15:43
Hi Nigel,
That is the code you suggested last time - and which I think must have worked then. It does not seem to work now. It does produce a TIFF file but nothing (I have tried) can read the file. Most programs just give a general file read error but IMDisplay (part of ImageMagick) is a bit more helpful, that says "Incorrect count for 'BitsPerSample'". I tried messing about with the BitsPerSample parameter but that just raised more errors when trying to create the TIFF in ImageEn.
My sample code & image are attached.
xequte Posted - Mar 02 2024 : 20:18:28
Hi

This code works for me:

// Save a PNG with alpha to TIFF
ImageEnView1.IO.LoadFromFile( 'D:\Alpha.png' );
ImageEnView1.IEBitmap.PixelFormat             := ie24RGB;
ImageEnView1.IO.Params.TIFF_PhotometInterpret := ioTIFF_RGB;
ImageEnView1.IO.Params.SamplesPerPixel        := 4;
ImageEnView1.IO.Params.BitsPerSample          := 8;
ImageEnView1.IO.Params.TIFF_Compression       := ioTIFF_UNCOMPRESSED;
ImageEnView1.IO.SaveToFile( 'D:\Alpha.TIFF' );

Can you show me your code and your source image.


Nigel
Xequte Software
www.imageen.com