Jump to content
rui_mac

How to apply Levels or Curves to an Alpha?

Recommended Posts

Sometimes, in Photoshop, I need to apply global adjustments to an alpha channel.

So, I use Levels or Curves or whatever, to any alpha channel (be it attached to a layer or not).

In Affinity Photo, when I try to apply Levels, for example, it is only possible as an Adjustment, so it is applied to the layer, not to the mask.

So, how can I apply Levels, Curves or whatever to a mask?

Share this post


Link to post
Share on other sites

A mask is not more than a greyscale image. Sometimes I need to make global changes in density, brightness or contrast to a mask. Sometimes I even need to create solarization effects on a mask (easy to do with Curves).

That is very easy to do in Photoshop but seems to be very complicated (or impossible) to do in Affinity Photo.

 

Basically, everything that can be done to a grayscale image could also be possible to do with a mask because that is exactly what it is.

Share this post


Link to post
Share on other sites

I understand. Working with masks still needs a lot of work.   Hopefully they'll get there.

 

Also I just tried to quickly "invert" my Alpha Channel (Command + I  in Photoshop) and in Affinity I get an "Invert Adjustment" but it's applied to the Layer no the mask....      


------------------------

 

Fernando Velarde

 

www.velarde.com

Share this post


Link to post
Share on other sites

Hello Andy.

 

Thanks for the response.

 

The command shortcut you mention is to invert a Selection. Very useful also.

 

But In Photoshop when you invert a mask it automatically turns everything that was white into black and viceversa.

 

Two different shortcuts

Command + I  (To invert the Image or Channel)

Command + shift + I ( For selections) 

 

You do hace the same shortcuts. The problem is that when I'm woking in the Alpha Channel (or mask) in Affinity Photo and I use the Command + I shortcut the Invert Adjustment is applied to the Image not the Mask.

 

Don't worry. Just pointing things out as I'm putting the Beta to test. The Layers, alpha channels and such while maybe not important to the causal users are the daily tools of Photo Retouchers , Designers and power users.

 

P.D. From what I'm seeing  in all of the advances. I'm 99% percent sure I'll buy a copy of the software (once it's released) to support the development. 

 

Good luck


------------------------

 

Fernando Velarde

 

www.velarde.com

Share this post


Link to post
Share on other sites

Definitely. I mean, the masks/alphas are the bread & butter of professionals.

Like I said in a previous post, sometimes, when creating a complex composition or when doing professional color calibration, almost 80% of the time spent is in doing accurate masks.

Share this post


Link to post
Share on other sites

I will definitely buy a copy of Affinity Photo (and Affinity Publish  :) ).

I'm trying to force myself into doing all my smaller projects in Affinity Photo, instead of using Photoshop, just to get the hang of it.

However, I rely heavily on masks and there seems that there is still a lot to be done about this subject. So, many, many times, I still have to use Photoshop  :(

Please, please, make masks powerful and easy to deal with.

Oh, have I said how important masks are?  ;)

Share this post


Link to post
Share on other sites

@ rui_mac 

 

I don't have a great need for masks and therefore am not one who relies heavily on this feature.   However, by chance I have used them quite a bit with this release, and am not sure what it is that you mean by make masks powerful and easy to deal with.  I found the process easy and the refine tool straightforward to use, and could create an accurate mask even in testing circumstances.   

 

I'm not disagreeing with you or challenging your expertise, I just don't use PS so cannot evaluate what you say directly - could you please give me some examples that illustrate what you feel is lacking?

 

Thanks!


Retina iMac (4K display, 1TB SSD, 16GB RAM) OS X 10.11.6  Capture One 10.

 

Share this post


Link to post
Share on other sites

Have you seen the video I posted above? It shows some examples of the types of things I usually do with masks.
Also, I apply filters to masks to create aging effects or grunge maps.

Basically, like I said above, a mask is a greyscale image. And we should be able to do with a mask everything that can be done with a greyscale image.

Be it, applying filters or adjustments.

Share this post


Link to post
Share on other sites

Thanks rui_mac, I had overlooked that (I have a reflex that blinds me to all things Google, which is why I appreciate the AP videos in Vimeo - as well as them being good!).

 

It's 11:36 PM, I'll look at it in the morning  :)


Retina iMac (4K display, 1TB SSD, 16GB RAM) OS X 10.11.6  Capture One 10.

 

Share this post


Link to post
Share on other sites

@rui_mac

 

Looked at the linked video.  All is revealed, so to speak.  I would place what you show there as design rather than photography.  What you are doing is neat, but not something that I'd ever want/need, hence our different conclusions on the (current) position with masks in AP.  (BTW, there was no sound on the video but others on the same YouTube page played OK; not sure if there is any in the original).


Retina iMac (4K display, 1TB SSD, 16GB RAM) OS X 10.11.6  Capture One 10.

 

Share this post


Link to post
Share on other sites

No, there is no sound. I recorded it late at night and my baby was sleeping in the room next to the office so I didn't recorded sound :)

 

I have been a photo retoucher / compositor / color calibrator for over 20 years now. And let me assure you that masks operations are used on a daily basis by professionals. We must be able to do lots and lots of stuff with masks. Even if it is to "design" and not only to "correct" (composing is more "designing" than "correcting" ;) )

 

Here are a few example of some very old Photoshop stuff I did while working at an agency:

 

http://www.ruimac.com/photoshop/

 

All of those examples used lots of mask operations.

Share this post


Link to post
Share on other sites

@rui_mac

 

Agree with what you say here, and enjoyed looking at the gallery in the link.  

 

However, AP does all I want/need in composing/correcting or even designing, and I have no need or desire to purchase any Adobe offerings.

 

Mind you, it's more than 50 years since I took, developed, and printed my first real photographs, and it's hard to shake off the mantle of what you shoot at the beginning is what you get when you print at the end :) .


Retina iMac (4K display, 1TB SSD, 16GB RAM) OS X 10.11.6  Capture One 10.

 

Share this post


Link to post
Share on other sites

I really would like to be able to go All-Affinity products.
And, if I can't make to a mask whatever I can make to a simple greyscale image (paint on, apply filters, aply adjustments, Liquify, etc), I can't simple ditch Photoshop :(

Share this post


Link to post
Share on other sites

I understand that!  I worked for a time in a technical accreditation field, as an assessor and as a trainer, and we always taught that quality is meeting the needs and wants of the users, not the cheapest or flashiest or biggest.  Quality for you is clearly at the upper end of the spectrum.   Looking at your knowledge investment in PS, it makes sense that you'd be reluctant to walk away from it.


Retina iMac (4K display, 1TB SSD, 16GB RAM) OS X 10.11.6  Capture One 10.

 

Share this post


Link to post
Share on other sites

Am I being dense here? I can't see how levels or curves would affect a mask.

 

In any good photo editor, a mask is grayscale so that it can also function as a partial selection, which produces a soft or aliased selection edge. If you didn't have that, a mask would only have black and white, and that would make for hard, jaggy mask edges. That aliased edge appears in the mask as intermediate gray shades at the transition between the white subject and black mask areas. One purpose of running levels or curves on a mask is to manipulate the gray shades at that transition.

 

If you have a mask for a person and the mask edge is too soft, you can harden the mask edge in Photoshop by opening Levels and increasing contrast just for the mask. That mask edge can be manipulated using various combinations of blur or sharpen, increase or decrease contrast, etc. Using these techniques the mask edge can be softened, hardened, shifted in, shifted out...

 

Another purpose for levels and curves in a mask in Photoshop is to limit the minimum or maximum effect of the mask by moving the Levels white point or black point for a mask so that its minimum or maximum output tonal value is now away from black or white.

 

Because this is about masks, this is certainly not just about graphic design. It is definitely applicable to photography. Masks are central to advanced photographic tone and color correction in Photoshop because of their power in controlling the mask effect intensity and the quality and position of the mask edge, so being able to run levels and curves on a mask to manipulate its tones is an extremely useful ability that should be in Affinity Photo or any true professional image editor.

Share this post


Link to post
Share on other sites

When I came across Affinitiy Photo recently, I was very impressed about many aspects and features of the software.

 
Today I have therefore tried a typical workflow from RAW-processing to final photo-retouching.
 
While trying to working with alpha channels I've unfortunately reached my limits of working with this software.
 
As ui_mac already mentioned, working with alpha channels is indispensable for professional image editing.

Share this post


Link to post
Share on other sites

"should be in affinity photo or any true photo editor"

"unfortunately reached the limits of affinity photo"

"this feature is indispensable for professional image editing"

"make masks powerful and easy to deal with" - (as if they weren't already, with features like the super powerful refine tool, and the way you can easily edit, move and toggle masks!)

Etc...

 

It amuses me the passive-aggressive tone of people wanting Affinity to "hurry up" with their pet feature requests. It is like that in almost every feature request thread, and quotes similar to the above are seen everywhere on this forum. Usually in some obscure little thread, with only an irate original author doing most of the bumping and posting.

 

Massive props to the moderators for reading through these walls of text.

 

Serif works on features in order of global priority, and will get to everything important first and deal with nice extras when time allows. That's basic business management.

 

If the ability to use levels/curves on masks was as "essential" as the passive-aggressive posts here imply, it would already have been implemented. The same goes for all other feature requests that use passive-aggressive threat language. Relax. They've just released 1.0 and it will keep growing over time.

 

By the way, I have used photoshop for pixel based website designs for 15 years with loads of masking work in every project and never needed to use levels or curves on masks. I could see that it has a very minor value for very specific workflows but not much else. Besides, they've confirmed that mask editing will be improved later. What more do you want from them? These are real people you are talking to and they're working extremely hard in the wake of the launch to get truly *important* things fixed, like newly discovered crash-bugs and the like.

 

If you are so in love with minor features that photoshop has had time to develop in its nearly 30 years of development then stay with creative cloud, it seems you're happier that way. Personally, I ditched a 15 year relationship with Adobe, cleaned their crud out of my computer, and couldn't be happier! Affinity Photo is fast and slick and buttery smooth and does almost everything that Photoshop does, and it's going to keep evolving over the years, just like Affinity Designer has done. I for one know I made the right choice. Affinity kicks ass. And what other company is as interactive with their customers?

 

PS: In the YouTube video posted above, the author is creating a single-colored floodfilled layer of black or orange, and then using a mask to turn the fully filled layer into only a visible shadow outline, and then blurring that mask. Everything in that video was silly and overcomplicated. I'll just point out the obvious: Stop filling your layers with a solid color. Get rid of the mask completely and make all shape adjustments on a pixel layer with attached non-destructive adjustment layers like levels, curves and gaussian blur (use a live filter and you can paint the filter's own individual mask to gradually fade the blur). Because all you've achieved in the video was to move the pixel-work (of creating and blurring shapes) into a useless mask layer, for no gain whatsoever. If you did that so that you could easily recolor the shadow later, then that is pointless too, since you can simply apply a hue/saturation filter instead.

Share this post


Link to post
Share on other sites

@aitte

 

"Besides, they've confirmed that mask editing will be improved later.”

 

Thank you for this information. I am very happy to hear that.

 

 

Personally, I ditched a 15 year relationship with Adobe, cleaned their crud out of my computer, and couldn't be happier!”

 

Well done. After what I’ve seen from Serif, I’m very optimistic to do the same with what is left of Adobe-Applications on my computer very soon. 

 

 

”Affinity Photo is fast and slick and buttery smooth and does almost everything that Photoshop does…”

 

No one expects software, which is hardly out of beta, to be perfect.

 

 

Affinity kicks ass.”

 

It very much looks like that.

 

 

Massive props to the moderators for reading through these walls of text.”

 

They do the impossible. I'm sure they are prepared for it.

Share this post


Link to post
Share on other sites

"Get rid of the mask completely and make all shape adjustments on a pixel layer with attached non-destructive adjustment layers like levels, curves and gaussian blur (use a live filter and you can paint the filter's own individual mask to gradually fade the blur)"

 

Actually, it doesn't do the same.

Using a live filter with a mask to gradually fade the blur will do what the description says: it gradually fades the blur. The problem with gradually fading the blur is that there are areas where you get a percentage of the blur blended in a non-blurred image. This is because the live filter is applying the full radius of the blur and the mask is only fading that full radius blur. It is not applying increasing amounts of blur, which is what I want to make it more realistic.

So, the live filter with a mask produces this:

 

masked_filter.jpg

And my method, with the use of mask manipulation, will produce this:

 

my_method.jpg

There is no sharp image blended with a blurred image in some areas. There is only an increasing blur, from less blurred at the bottom to more blurred at the top.

 

And yes, I know that mask manipulation is still being worked on. That is great.
I hope I can completely replace Photoshop with Affinity Photo. But, until I can do whatever I want with a mask (that is just a greyscale image, after all), I can't do it.

And if I delivered a post-produced image using the method of the live filter with a gradient mask to the agency that usually hires me for doing photo compositing, they would tell me that it is not the quality standard I usually deliver.

Share this post


Link to post
Share on other sites

@rui_mac: Alright, so a Gaussian Blur live-filter won't work the same way (since you're right in that it blends between blurred and non-blurred areas in an unnatural way). That was just a shortcut I suggested, for even greater non-destructive efficiency, but clearly it doesn't work with all effects. The fact that the "bonus shortcut idea" won't work still doesn't change this part of my post:

 

"Stop filling your layers with a solid color. Get rid of the mask completely and make all shape adjustments on a pixel layer instead. Because all you've achieved in the video was to move the pixel-work (of creating and blurring shapes) into a useless mask layer, for no gain whatsoever. If you did that so that you could easily recolor the shadow later, then that is pointless too, since you can simply apply a hue/saturation filter instead."

 

So, all you need to do is this:

1. Make a selection from the original text layer.

2. Create a new layer and fill the selection with black.

 

Now do all your destructive gaussian blur, etc, on the pixel layer.

 

The core point was still this: You're filling the whole canvas with black, then creating a pixel-based mask, and doing your work on the mask, and then complaining you can't blur the mask etc. That's insane. Just work in the pixel-portion of the layer. Literally everything you showed in that video with masks can be done as pixel layers. All you did was move the pixel-based work of blurring etc over to the mask instead of the layer.

 

And yes they'll finally implement the ability to do effects on layers someday. But your video was not a demo of how that would be useful.

 

Also remember this: If you really have a need to do all the pixel-based work in the mask instead of the pixel layer (for example if you want to mask a complex image to create a "shadow" based on a cutout from a flat image layer), then you could actually create a layer, do all the work as pixels (blurring, moving, etc), then "select layer contents" and create a mask from that selection. You'd achieve the same final mask result as in your video. And if you ever need to edit that mask again later, you could select the mask, fill the selection as a pixel layer, do edits, and then create a mask from it again.

Share this post


Link to post
Share on other sites

All layers have an alpha channel associated (in Photoshop or in Affinity Photo). Even if they don't have additional alpha masks, ALL layers have, at least an internal alpha channel associated.

When I create a pixel based layer, it stores RGB information and alpha information too. In Photoshop, the layer and associated alpha are internally compressed (don't know if they do the same in Affinity Photo).

However, due to non-continuity of pixel values, compression is not always very efficient. And compressing and decompressing, on the fly, taxes computer resources. The more contiguous color we have (in any or all channels), the more efficient the compression/decompression procedure is.

When I use a Solid Color (in Photoshop) or a Rectangle (in Affinity Photo), I'm creating a parametric object that weights almost nothing, in terms of storage. Also, it is highly compressable (if it even needs compressing). This means it only stores the parametric information and an 8 bit (or 16 bit) alpha channel.

So, using a Solid Color or an Object is always much more efficient than using pixel based layers.

Specially when dealing with HUGE documents (and, sometimes, I have to create 90+ layer documents, with several GB of size).

Of course I also use pixel based layers sometimes, when I find it more useful or flexible.

 

I know how Photoshop works inside. I have been using it since version 1.0 and I'm a Photoshop teacher. I'm also a programmer and I usually decide on what methods to use depending on what I know that is happening "under the covers", structurally and code-wise.

 

I hope I can get as proficient and knowledgeable in Affinity Photo as I am with Photoshop :)

Share this post


Link to post
Share on other sites

It's true that the 8-bit alpha layer uses less bits per pixel than the 24-bit ( 8 each for R, G, B ) raster layer. But using masks like this sounds like micro-optimization, and it assumes that the image editor applies compression to the "R:0, G:0, B:0" black pixels of your pixel layer.

 

Are you seriously constructing entire documents out of flat pixel rectangles with masks on them? That sounds like a nightmare to maintain. Have you really seen sluggish performance if you just used raster layers instead like everyone else? I frequently made Photoshop designs out of hundreds of individual (mostly non-masked) layers for each component of the website design, and never felt limited by the RAM or CPU usage.

 

By the way, I suggest trying to work entirely with raster/pixel layers in Affinity Photo, and seeing if the performance is good enough, before you carry over this ancient "use masks instead of pixels to save a few kilobytes of memory per layer" Photoshop workaround.

 

This is a brand new program, so let's not assume it has the same internal limitations or memory structure as Photoshop. :-)

 

If any Serif/Affinity developers are reading, I'd appreciate their input on this quirky Photoshop technique.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×