Hi,
I'm a novice. I need to create a transparent jpg file with circles at some ponts and superpose that image to another jpg and save the merge to another file.
Thank you in advance for a little help
Masconti
Create a Transparent Jpg with circle and merge with another jpg and save to file
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
Jpeg doesn't support transparency. You will have to use another image format. .png or 32 bit bmp maybe. Freebasic has internal support for the latter.
Last edited by Boromir on May 08, 2017 0:56, edited 2 times in total.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
With fbImage you can save images with transparent (alpha) channel as *.PNG files.
Joshy
Joshy
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
Thank you for your answer.
My need is to put in evidence with some small circles png image points
My need is to put in evidence with some small circles png image points
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
or he could just save the images as transparent BMPs without any additional libraries... but, very little support for those out thereD.J.Peters wrote:With fbImage you can save images with transparent (alpha) channel as *.PNG files.
Joshy
but, if we take what he asks for, bit by bit, we can deduce that he really does not need any transparent format:
"I need to create a transparent jpg file with circles at some ponts and superpose that image to another jpg and save the merge to another file. "
Image #1: Raster Image with transparency and a few circles at certain points
Image #2: Raster Image
Image #3: Overlay Image #1 on top of image #2 and save the resulting file (does not need transparency anymore)
So the questions are:
(A) Do we fully create Image #1 from code, or are we loading up an existing image and making circles and such?
(B) What is the filetype of the existing image #2?
(C) What is the desired format of the final image? - since it does not need transparency, it can be any type of file.
If the answer to A is 'Yes, we are creating the image' and the answer to B & C is BMP, then we do not need any additional libraries....
-
- Posts: 538
- Joined: Jul 15, 2005 4:13
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
You want to take a jpg and make clear circles on it??
Thats easily accomplished.
Thats easily accomplished.
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
but it is impossible to save the resulting image, with some parts transparent, back as a JPG file since JPG does not support transparency...thesanman112 wrote:You want to take a jpg and make clear circles on it??
Thats easily accomplished.
-
- Posts: 538
- Joined: Jul 15, 2005 4:13
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
just convert the file in windows paint, then load the bitmap, draw some circles on it that you want with drawing primitives, and save the bitmap...then load it in windows paint and save as JPG again if need be.
but truth be told I know theres code for loading a JPG in FB, seen it before...just don't know where....
but truth be told I know theres code for loading a JPG in FB, seen it before...just don't know where....
-
- Posts: 538
- Joined: Jul 15, 2005 4:13
Re: Create a Transparent Jpg with circle and merge with another jpg and save to file
obviously you could add a little code to control a mouse on the screen and could either make circles of preset size or
use a couple keys to add or subtract to a circle on the screen, and allow user to save the file when needed,,,,why not just use windows paint and do
everything needed???
use a couple keys to add or subtract to a circle on the screen, and allow user to save the file when needed,,,,why not just use windows paint and do
everything needed???
Code: Select all
dim as integer x,size
screenres 640,480,32,2
screenset 1,0
'****remove following rems to make a BITMAP to draw on, and saves to file.
'for x=1 to 1000:pset(int(rnd*640),int(rnd*(480))),rgb(int(rnd*255),int(rnd*255),int(rnd*255)):next
'bsave "bitmap.bmp",0,24
bload"bitmap.bmp"
for x=1 to 25
size=int(rnd*100)
circle(int(rnd*640),int(rnd*480)),size,rgb(int(rnd*255),int(rnd*255),int(rnd*255))
next x
screenset 0,1
sleep