About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
Image layers
Author Message
laugan Offline
Member

Post: #1
Image layers
Hello!

I have two images (for example both with alpha channel) and i need to create one image from them. The problem is that i tried some functions as ColorMul() and ColorAdd() (i tried to merge images by pixels) but all these functions do not make the same effect as two layers in simple image editor (PS, gimp etc) and colors are VERY far from what i need.

Is there any way to merge two images with alpha?
06-04-2013 07:35 PM
Find all posts by this user Quote this message in a reply
laugan Offline
Member

Post: #2
RE: Image layers
okay i figured it out, just another function that's not included in EE smile
06-20-2013 08:24 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #3
RE: Image layers
My guess would be that you multiply the colors by their alpha % then add them together. What was the solution you came up with?
06-20-2013 02:07 PM
Find all posts by this user Quote this message in a reply
laugan Offline
Member

Post: #4
RE: Image layers
(06-20-2013 02:07 PM)Rubeus Wrote:  My guess would be that you multiply the colors by their alpha % then add them together. What was the solution you came up with?

Nope smile
From Wiki:
[Image: e28591f36ea3860326d80611d57613c2.png]
where
BackColor — initial pixel color,
ForeColor — color of pixel that we want to add,
Transparency [Image: 6dcd8c9cd2db6deca4f93d37af767744.png] — transparency of pixel that we want to add.
06-21-2013 05:55 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #5
RE: Image layers
Actually, I was pretty darn close. Don't forget to clamp to 255, though, or you will get some very strange effects.
06-21-2013 01:22 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Image layers
EE 'ColorLerp' function can be used for that.
06-23-2013 04:19 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #7
RE: Image layers
Oh neat! i didn't know ColorLerp served the same function as what laughan posted. This is good to know.
06-23-2013 04:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply