What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Transparent Tape upload issue


Hi!
I'm not sure what you're looking for
but if it can be useful to you, here are other bandages which when edited as in the picture (sorry for the language) could satisfy you.

or

Alexandria.jpg
tape.jpg
 
Hi @Alexandria

It took a bit of work yet I created an equivalent PNG file for this set of clear tapes. It is also at a higher resolution.
I started from a free vector file online that parallels exactly the PSD file you have (many hundreds of Layers including a multitude of blend modes used)
Neither the vector file nor the PSD file could be directly converted and saved as a PNG to use on its own.

The PNG file I created was derived from two output cases when using two different backgrounds with the more complex files to create the single PNG with transparency file.
Since I used those other files as a starting point, I am providing the required attribution link in each of the files images provided.

An more detailed explanation is provided at the end of this post yet here are the results:

First here is the PNG file (it won't look transparent yet just save this file for the PNG version:

Clear-Tape-PNG-Format.png


Here is a screen shot of how the PNG file will appear in Photoshop:

Screen Shot 2023-08-23 at 11.47.26 AM.jpg

Here is a screenshot of the PNG file with a 50% gray background:


Screen Shot 2023-08-23 at 11.50.58 AM.jpg

Here is the PNG file with a black background:

Screen Shot 2023-08-23 at 11.51.12 AM.jpg

And here is screenshot with the PNG file and a White background

Screen Shot 2023-08-23 at 11.51.26 AM.jpg

Here is a quick example of applying the tapes over an avatar:

Screen Shot 2023-08-23 at 12.55.24 PM.jpg

Hope that solves your problem for your project @Alexandria. If you have more questions just ask.
John Wheeler


Now for those interested in the derivation of this PNG file, it was done using the output image from the original file with a black background I will call this R1 for Result 1 (same as an image above above) and also the output image using the original file with a white background which I will call R2 for Result 2 (same as an image above).

Now without going through a longer derivation of the equations:

The equation for the Opacity which is Layer Mask (or Transparency in a PNG) is:

Opacity = 1 - R2 + R1 which is the same as Opacity = Inverse or R2 + R1

The equation for the pixel portion of the PNG is:

Pixel Values = R1 / Opacity

Following is the image for the Pixels values with Transparency removed from these equations:

Screen Shot 2023-08-23 at 12.39.32 PM.jpg

And here is an image of the Layer Mask from the equations:

Screen Shot 2023-08-23 at 12.39.56 PM.jpg

The above results were achieved using Layer Blending with Linear Dodge for addition and Blend mode Divide for division in the equations. Inverting an image was simply using CMD + I.

The hard part for me was deriving the equations that create the result and I am not including that here as that is even dryer than above :). Was a fun challenge for me thougt :)


FYI
John Wheeler
 
Last edited:
John, you are unbelievable. That is awesome. Thank you so, so very much. :thumbsup:I just "flew over" your explanation since my brain no longer understands such complexity. If I maybe read it 349081902830145 times, it will sink in :D

So I tried it and it works, only thing is ... it is one "layer", so I have to cut the band aids to place, I got that right? Also, the edges are somewhat "rough" when resizing, how can I fix that or also the clarity on one layer?
back.JPG
 
Hi!
I'm not sure what you're looking for
but if it can be useful to you, here are other bandages which when edited as in the picture (sorry for the language) could satisfy you.

or

View attachment 139457
View attachment 139458
Thank you, also for the links
 
Hi @Alexandria

You're welcome.

Yes you are doing it correctly where you would either crop or mask the bandaids as you desire.

To the first order this has to do with the resolution used in the original image. What I did was create a 5 pixel border around the edges (10 pixel total width) and applied a 5 pixel gaussian blur. That version of the PNG is posted below and should less pixelated edges at the expense of slightly softer edges.

If a better result is required a higher resolution version could be created from the original vector images. Check and see if this PNG version does it for you.
Glad you like the result
John Wheeler

Clear-Tape-PNG-edges-blurred.png
 
@thebestcpu

John,
Extremely impressive! I tried to follow your explanation as best as I could and then see if I could replicate the result. I came fairly close, but I did not download the original vector files from Freepik.com as my starting point, so that probably accounts for mine being slightly off.

One question: your calculated "Opacity" image (which ultimately becomes the layer mask) is nearly, but not quite, identical to R1. The more I think about it and try to follow your logic and calculations, I'm not sure why R1 itself wouldn't be the layer mask. What is the theoretical difference between Opacity and R1?
 
@thebestcpu

John,
Extremely impressive! I tried to follow your explanation as best as I could and then see if I could replicate the result. I came fairly close, but I did not download the original vector files from Freepik.com as my starting point, so that probably accounts for mine being slightly off.

One question: your calculated "Opacity" image (which ultimately becomes the layer mask) is nearly, but not quite, identical to R1. The more I think about it and try to follow your logic and calculations, I'm not sure why R1 itself wouldn't be the layer mask. What is the theoretical difference between Opacity and R1?
Hi @Rich54

That is a good question. I had only derived the exact equations from the Layer math with transparency with arbitrary backgrounds. The equations should work to create the original opacity and pixels (PNG equivalent) for any transparent image for which you only have R1 and R2.

You may want a different question answered yet if what you want to know is "what is the difference if we only used R1 as the opacity" then that is what I will answer below.
Keep in mind, we are trying to derive both the Opacity Layer as well as the Pixel Layer for the original image as both are an unknown if we have just R1 and R2.

In the discussion below I will use R2i to mean the inverse of R2

As a recap, the original equations were:
Opacity = R2i + R1
Pixels = R1 / Opacity

If I only use R1 then the equations become
Opacity = R1
Pixels = R1 / R1 = 1 or just pure white

So right off the bat if I use a Pixel Layer of all white and Opacity or R1 in combination of a pure white background:

I get pure white (screenshot)

Screen Shot 2023-08-24 at 8.56.30 AM.jpg

Vs the correct answer:

Screen Shot 2023-08-24 at 8.57.06 AM.jpg

So first just using R1 as Opacity does not get a good result with lighter backgrounds applied
So now lets check darker backgrounds applied

Here is using Pixel = White with the R1 for Mask Result

Screen Shot 2023-08-24 at 9.13.35 AM.jpg

Here is the fully correct result:

Screen Shot 2023-08-24 at 9.15.22 AM.jpg

Is a closer to the correct answer and may suffice for darker backgrounds yet it depends on the accuracy you want.

So how far off are the two images from a ratio standpoint e.g. fractional off. That can be determined the correct version into the version just using R1 instead of R2i + R1 shown in the image below. Note that pure white would mean identical and as you get darker it is further off (a 50% gray value would be 1/2 the correct value)

Screen Shot 2023-08-24 at 9.30.20 AM.jpg

The dark areas show where the area is highest. That is also where the image is darker so it is less noticeable
(note the pure black areas in the background is zero divided by zero which is undefined)

Bottom line, when applying lighter backgrounds, just using R1 instead of R2i + R1 is relatively way off (white vs seeing an pattern)
When using a darker background, visually the difference is not as large as they differences are i the darker regions unless you care about how far off % you are.

And finally, when using the exact equations give you the correct answer with all backgrounds and easy to create with Layer Blending (could even be an easy Action) why not use the correct versions.

This may be way overkill to your question and that is even assuming I understood your question 🤣 That's what you get when you ask an analytic for a math answer 🤣
John Wheeler
 
This may be way overkill to your question and that is even assuming I understood your question 🤣 That's what you get when you ask an analytic for a math answer 🤣
John Wheeler

Yes, you understood the question perfectly. Way back, half a century ago, I majored in math in college, so I had to dust-off some old brain cells to follow your algebra. Your last post actually cleared up why my result was close to yours, but not quite. In your detailed Post #22, I misinterpreted the formula for Opacity as:

Opacity = Inverse(R1+R2)
instead of the correct formula Opacity = R2i + R1

And then, when I did my experiment substituting R1 as the opacity layer mask, I only checked it using dark backgrounds, so I missed the fact that it fades out too much against light backgrounds. I just now redid everything and I get exactly the same transparent PNG as you.
 
Yes, you understood the question perfectly. Way back, half a century ago, I majored in math in college, so I had to dust-off some old brain cells to follow your algebra. Your last post actually cleared up why my result was close to yours, but not quite. In your detailed Post #22, I misinterpreted the formula for Opacity as:

Opacity = Inverse(R1+R2)
instead of the correct formula Opacity = R2i + R1

And then, when I did my experiment substituting R1 as the opacity layer mask, I only checked it using dark backgrounds, so I missed the fact that it fades out too much against light backgrounds. I just now redid everything and I get exactly the same transparent PNG as you.
Glad to get the confirmation and much appreciated.
BTW - This procedure only works to substitute for all those Layers and various blends if they are all operating linearly in each of the Layers. There may be othe limitations as well yet was really just trying to get a solution for Alexandria.
I would be very surprised if this has other applications to be useful and more likely more of a curiosity of how to back out the original Layers and Mask from result images.
More of a brain exercise than anything else (for those inclined towards math)
;)
 

Back
Top