Link to home
Create AccountLog in
Delphi

Delphi

--

Questions

--

Followers

Top Experts

Avatar of Manuel Lopez-Michelone
Manuel Lopez-Michelone🇲🇽

Mimic an image by putting letters and symbols superimposed on it

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? 

User generated image

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Paul SauvéPaul Sauvé🇨🇦

you can create the files in png.
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 GIMPPaint.net which use layers (.xcf & .pdn formats respectively), PhotoshopCorelDraw (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 Types
User generated image
to recapitulate - to create an IMAGE FILE of superimposed images, use software that supports LAYERS and use images the support TRANSPARENCY!

Avatar of Manuel Lopez-MicheloneManuel Lopez-Michelone🇲🇽

ASKER

Thanks, I really want to do it with my own software. It seems I have to use PNG images. Right?


Avatar of Paul SauvéPaul Sauvé🇨🇦

use .png, then, if possible save file.png, then save as file.jpg

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Jonathan D.Jonathan D.🇮🇱

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?

 

User generated image


Well, there aré some good support for jpg files and in fact, I have too many jpg imagen to work with. 


Avatar of Jonathan D.Jonathan D.🇮🇱

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;


Free T-shirt

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.


Avatar of Sinisa VukSinisa Vuk🇭🇷

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).


Avatar of Jonathan D.Jonathan D.🇮🇱

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?


Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of Sinisa VukSinisa Vuk🇭🇷

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

thanks a lot…

Delphi

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.