Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / ImageTrans

Author
Message
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 9th Jun 2005 10:32 Edited at: 12th Jun 2005 07:21
The program is like the program VanTrans, which takes two images and makes a transitional image for a smooth-looking transition to another texture. The textures and masks must be the same size and must be 800x600 or less.

It can be downloaded off my site, in the project section:
http://www.freewebs.com/neodragon64/

Please give feedback

(I also have post in DBP section but not much sucsess so I thought it might be better to post about it here)

Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 9th Jun 2005 16:50
what i wonder is how u did this
it isnt opensource is it?

formerly shadows of emptiness
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Jun 2005 18:24
Looks cool!

Someone emailed me last week becuase VanTrans is not compatible with XP - I do plan to update it in the future but this is great as it'll be fine in XP, I'll direct him here .


Van-B

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jun 2005 19:49 Edited at: 9th Jun 2005 19:50
Quote: "what i wonder is how u did this"

The theory is that the mask tells you how much of each image you should use for each pixel.

In practice, you need somebody like NeoDragon or Van B to take all the hard work out of it and provide you with a tool like this.

Nice work

BatVink
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 9th Jun 2005 21:05 Edited at: 10th Jun 2005 06:55
Memblock my friends, memblocks

Thanks everyone for the great feedback. I made the program in 3 days .

If you really want to see some code, I may release some in the future.

@Van B
I have XP and I'm able to use VanTrans. It could only use 128x128 textures and I needed bigger ones.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Jun 2005 21:43
Hmmm, you did'nt have to do anything strange to it? - I thought maybe running it in 98 compatibility mode would work, but I use 2000Pro so could'nt test it.

One thing I plan to look into is using it to apply an alpha mask to an image - unless you have photoshop, making alpha transparency textures is damn niggly. I reckon there's lots of uses for programs like this that haven't been explored. Also, using a heightmap mask instead of a gradient mask would be handy for making terrain textures - especially if there's no strict size restrictions.


Van-B

Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 10th Jun 2005 05:30
An alpha mask couldbe easily done with memblocks. In my code, that is how I combine the images.

I set the alpha values for the images based on the mask and then pasted both images on top of each other as sprites. Then I used get image and saved them.

Easy .

Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 10th Jun 2005 06:43 Edited at: 10th Jun 2005 06:47
Doing this sort of thing really isn't as hard as you'd think.
Most of the blending types even by Masks are quite simply equasions, particularly blending in this mannor.

Remember 3 years ago myself and GuyS were doing speed experiments to see if R/T Blending was feasible in DarkBASIC Enhanced. Unfortunately not for R/T needs, but for pre-loading .. let's say Lightmaps heh it did the trick will albiet slow.

Generally the Equasion for Blending is a Simple Multiplication.

NewPixel = (Source1 * Source2) / 2

When a mask is involved what happens is only slightly different

fSource1 = (Source1 / 100.0)
fSource2 = (Source2 / 100.0)
NewPixel = ((Source1 * (Mask / 100.0) * (Source2 * ABS(Mask - 255) / 100.0)) / 2

[edit] heh got it wrong, but also that isn't the quickest way.

fSource1 = (Source1 * 0.01)
fSource2 = (Source2 * 0.01)
NewPixel = ((Source1 * (Mask * 0.01) * (Source2 * ABS(Mask - 255) * 0.01)) / 2

that doesn't look right but still multiplying values is far quicker than division.


You can then get really complicated and fun with things. I have a website explaining the mathematics behind the Photoshop Blending Modes if anyones interested.

Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 10th Jun 2005 06:52 Edited at: 10th Jun 2005 06:54
Raven is right. It is not very hard at all .

I did it all with getting each pixel color of the mask and storing it to an array.

Then I would set the alpha of each pixel in both images according to the mask. It is really simple if you understand memblocks.

Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 12th Jun 2005 20:57
Quote: "unless you have photoshop, making alpha transparency textures is damn niggly"

Yay for me having photoshop! And Van B I can run VanTrans in XP. But this program looks better as it can handle larger textures...YAY!


Thanks to Animeblood for the Logo!

Login to post a reply

Server time is: 2024-11-22 13:40:29
Your offset time is: 2024-11-22 13:40:29