11/9/2022 0 Comments Gimpshop transparency to alpha#Gimpshop transparency to alpha how toI want to know how to do this in Photoshop. It does this in such a way that if you were to place a layer beneath the altered one filled with the color you just turned to alpha, the original image would return with no alterations. Again, it takes a color you specify, does some math stuff, and spits out an altered color value with transparency for each pixel. Step 3: It sets that pixel's new channel color values based on its previous calculations and then it gives that pixel the transparency it used throughout all that process, and then it moves on to the next pixel. The moral of the story is now we have Color Values for each channel and an Alpha value for the whole pixel. #Gimpshop transparency to alpha codeThe author's notes said something about a max-min relationship and optimizing code or something, and this is the part that confuses me. Step 2: Now it takes that largest Alpha value and plugs it back into the original equation to solve for the actual color value for each channel. Step 1.5: Next it compares the resulting Alpha values from the 3 different channels and picks the largest one to be used for the remaining calculations. Then it sets "Ca" to either max or min depending on which of those numbers is bigger and carries out the calculation from the above equation to solve for Alpha. How it does that is it takes your supplied color and the corresponding source color value for the channel it's focusing on, and it checks which is larger. Step 1: It determines what the largest possible alpha value is for each channel based on the above equation. The general idea is you give it "Cb" and you know "Co", and it's job is to find "Ca" and "Alpha_a". I'm honestly not sure why this method works, but I'm going to ignore that and just tell you what it does. I'm going to outline the mathematical process that the code goes through to determine the alpha values and the RGB values for each pixel, and I want you guys to tell me how to do this in Photoshop. The Alpha symbols are exactly that: the alpha values for the Above layer and Bottom layer. "Co" is the color value of the resulting pixel, "Ca" is the color value of the above layer and "Cb" is the color value of the bottom layer. There are a lot of symbols here, and I'll explain them. In a nutshell, this formula calculates the color value for a pixel that is resultant from two semi-transparent layers with different colors in normal blending mode. Source: Wikipedia's article for "Alpha Compositing" After a lot of digging around on GIMP's source I found the code that does the math (and I'll post it if anyone wants it), and it all revolves around this formula: To me, this would be a difficult venture using color selection tools that photoshop has because of those red color gradients in the eruption, but after applying a simple Color to Alpha function choosing black (#000000 in html color) you can clearly see how what is left is the absence of the black pixels.įurthermore, adding a solid black layer just below it, the image returns to what it was before I performed the Color to Alpha.Īnd I can simply replace this black layer with a sky blue to get a nice sky that works well because all the pixels are what is left over from that black background.Īnd alright, to be fair, this is a terrible job with the center being all pink and everything, but I did this in literally 30 seconds and with a few tweaks it could look way better.Īnyway, that's what the function does, and I took it upon myself to get to the bottom of how this operation works. I found a picture of a volcano that I like, but say I wanted to make the sky a different color. The overall effect is something along the lines of: If you were to have a solid color underneath your now-slightly-transparent layer, the resulting image you see is the same as when you had started. It would be easy if this were a simple "pick a color and make each pixel with that color transparent" operation, but it's not. It essentially turns a color into a transparency value, but it's a little more complicated than that. I found that there is no official Adobe or third party version of this plugin (that seems stable anyway), and since I don't feel like learning C just to code my own plugin for Photoshop, I was wondering if someone might be able to tell me how to do what I'm going to describe.Ī background for those who don't know what Color-to-Alpha does: The most basic description is the plugin looks at each pixel and replaces a user defined color in that pixel with a corresponding alpha value. I just recently got CS5, and having been on GIMP since I started my amateur graphics designing I quickly noticed that a feature was missing from Photoshop: The Color to Alpha function. This is gonna be a long one so get comfy. Hi all you gurus and devious geniuses of the interwebs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |