Delphi
--
Questions
--
Followers
Top Experts
I wrote a delphi program that mimics a Ken Knowlton mosaic (using letters and some other symbols - https://www.knowltonmosaics.com/pages/LGreen.htm). I am building the mosaic using JPG files that I insert in the final canvas of the image (see a sample of what I want to accomplish). My problem is simple: jpg doesn't have transparency. Should I use PNG files instead? Is there a way to still use jpg files?

Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
save that file in case you want to modify it. SAVE AS .jpg to display the file
i use free software on my Win10/11 PCs GIMP & Paint.net which use layers (.xcf & .pdn formats respectively), Photoshop & CorelDraw (paid apps) also use layers. Layers permit to have overlay the previous layer with a new one. the last layer covers the previous one, which is why you should only add images which support transparency:
Comparing Different Transparent Image file Typesto recapitulate - to create an IMAGE FILE of superimposed images, use software that supports LAYERS and use images the support TRANSPARENCY!
![]()
Thanks, I really want to do it with my own software. It seems I have to use PNG images. Right?






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
if possible save file.png, then save as file.jpg
it doesn't work like that, he needs to encode it to png and then encode it again to jpg. you don't just save an image with a simple file stream just by changing the extension, it must be encoded it its own format. but yet again, he'll still lose the transparency effect though since jpeg is RGB (24-bit) and png is ARGB (32-bit), which means it doesn't have the alpha channel to support transparency. so the transparency will turn into black background instead, so it doesn't really matter.
Should I use PNG files instead?
Is there a way to still use jpg files?
you don't have a choice, but why do you insist on jpg though? is it because of Delphi's limit of component support?

Well, there aré some good support for jpg files and in fact, I have too many jpg imagen to work with.
I have too many jpg imagen to work with.
will it be a problem to convert them all to png? i mean, CloudConvert could mass convert them in batch;

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
I would go with png. Png is wide supported and used format. Why do you need transparency at all?
You work inside of app with TBitmap which uses transparency. Final result can be jpeg with background of your need (user can peek up).
Why do you need transparency at all?
i believe it is because he wants the letters and symbols to stand out, and not be distracted by an RGB background, which makes sense because it will be easier to make the foreground become clear to the user's sight.
Sinisa, thanks for your feedback. Can you give me an example code of two jpg images with transparency in the background?






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
thanks a lot…
Delphi
--
Questions
--
Followers
Top Experts
Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.
