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
 Preserve PNG transparency when saving from TImageEnMView database?

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
PeterPanino Posted - Dec 11 2023 : 06:37:07
In the demo \Demos\Database\DBMultiBitmap_AllRecords, I append images from PNG files with transparency:

fDBMultiBitmap.AppendImage('InTest.PNG');


I set the compression to UNCOMPRESSED:

procedure TForm1.DBMBitmapOnGetSaveParams(Sender: TObject; const Filename: string; Params: TIOParams);
begin
  Params.TIFF_Compression := ioTIFF_UNCOMPRESSED;
end;


Then I save the image that is currently selected in ImageEnMView1 with:

fDBMultiBitmap.GetImageToFile(idx, 'OutTest.PNG');


Unfortunately, the transparency in the saved PNG file is lost!

How can the PNG transparency be preserved in this process?

(also PNG_TextKeys should be preserved)
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 14 2023 : 19:29:28
Please email me for the latest beta. When TIEDBMultiBitmap stores images in blobs it will now load the image content directly (if ImageFormat is not specified). This maintains the original format, e.g. for SVG files, or PNG with transparency.


Nigel
Xequte Software
www.imageen.com
xequte Posted - Dec 14 2023 : 14:03:34
Hi Peter

At this time, ImageEn only supports loading SVG files as raster images, so they will be saved as an encoded image SVG if loaded in this way.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Dec 12 2023 : 16:47:41
An interesting detail in this context is if TIEDBMultiBitmap.ImageFormat is defined as ioSVG: SVG files are loaded from a file with AppendImage and displayed correctly, but when saved back to an SVG file, they are not saved as the original SVG files (containing XML paths) but as SVG files containing an encoded raster graphics image!

Is it possible to save the SVG files in this case as the exact same copies with XML paths they were previously loaded? (As is the case with PNG files).
PeterPanino Posted - Dec 12 2023 : 07:47:00
Hi Nigel,

Thanks. Now, it works, and the transparency of the saved PNG file is preserved.
xequte Posted - Dec 11 2023 : 22:30:17
Hi

AppendImage() will save the image to the database in the format specified by:

http://www.imageen.com/help/TIEDBMultiBitmap.ImageFormat.html

Ensure it is PNG, or just append the image (directly from file) using normal database methods.

I will make it do this automatically for matching file formats for a coming update.



Nigel
Xequte Software
www.imageen.com