30 Replies Latest reply on Jan 26, 2014 11:34 PM by c.pfaffenbichler

    alpha channels

    Nathan_Chestnut2 Level 1

      Hi

       

      Can someone pls advise

       

      A client of mine has supplied a jpg of a simple design on a white background

       

      The design is multi-coloured with a gradient applied - and I need to apply a solid single colour to the design

       

      I used the alpha channel to separate the design away from the background - making it a transparency

       

      But I can't apply a solid single colour using a layer mask - the gradient of the original design is still being picked up - pls see visual below

       

      I'm sure there must be a simple fix - any ideas would be appreciated

       

      example.png

        • 1. Re: alpha channels
          c.pfaffenbichler Level 8

          You can apply an Adjustment (Curves or Levels for example) to the Mask.

          But making the gray at the bottom black may also affect the edges at the top.

           

          Could you please post (a lores of) the original image?

          • 2. Re: alpha channels
            Nathan_Chestnut2 Level 1

            Hi, many thanks for the reply

             

            Yes, I tried that and the result is okay, but as you say affects the top part of the image

             

            Here's the original image

             

            Ideally, I'd be able to fill the marquee I'm left with - when I load the image in an alpha channel - with a solid colour

             

            example.jpg

            • 3. Re: alpha channels
              c.pfaffenbichler Level 8

              In this case the blue channel seems to be pretty much the best starting point.

              And the difference of the lighter part (the upper ones in this case) to the darker ones seems small enough that a global Adjustment should work fine.

              Then one could use that (invertedly) as the Layer Mask for a Solid Color Layer.

              1 person found this helpful
              • 4. Re: alpha channels
                Trevor.Dennis Adobe Community Professional (Moderator)

                With that lovely clean background, I'd go the easy route and select the BG with the magic Wand using a low tolerance value.  Then invert the selection > Make workpath from selection (icon bottom of Paths panel) > Layer > New Fill Layer > Solid Color.

                 

                And you have a Shape layer.  Always best to go with the vector graphic when it is that easy.

                • 5. Re: alpha channels
                  c.pfaffenbichler Level 8
                  Always best to go with the vector graphic when it is that easy.

                   

                  While vector data would certainly be preferable I do not quite agree in this case, because the resulting Path would likely need extensive manual emendations to be close to »good« and unless the image will be upscaled the effort may not be justified.

                   

                  Edit: And to me using the Magic Wand Tool seems pretty much unjustifiable in this case.

                  • 6. Re: alpha channels
                    Nathan_Chestnut2 Level 1

                    Thanks guys - I will try both ways and see which gives the best results

                     

                    On a slightly related note, is it possible to export vector data from photoshop to illustrator?

                    1 person found this helpful
                    • 7. Re: alpha channels
                      c.pfaffenbichler Level 8

                      You can

                      • copy/paste the Path elements

                      • use File > Export > Paths to Illustrator

                      • if Vector Masks are used save an eps with »Include Vector Data« checked and convert that with Illustrator

                       

                      Edit: And if it’s just one path an eps with a Clipping Path may suffice.

                      1 person found this helpful
                      • 8. Re: alpha channels
                        Trevor.Dennis Adobe Community Professional (Moderator)

                        To be fair, the first thing I did after pasting that graphic into Photoshop  (I always test) was look at the histogram, and there is significant tonal value from about 220 right up to full white, so there might be some risk using the Magic wand.  Dragging a small selection to isolate some of the lighter tones near the bottom of the motif, shows the red channel to be way up there at value 245, so you'd need to set the Magic wand with a tolerance of about 5 to be safe, and you are definitely relying on a very clean background with such a low tolerance.

                         

                        The Blue channel does make an excellent mask. You are spot on there.  The Histogram shows almost nothing in the Blue channel above value 30, and you rarely get better than that.

                         

                        I guess Illustrator > Trace and Simplify would be the best way to make it into a vector, but I am still pretty new to Illustrator.

                        1 person found this helpful
                        • 9. Re: alpha channels
                          John_Picton Level 3

                          Perhaps I am not seeing the problem correctly as to me there appears to be a very simple way of doing this.

                           

                          Use the blue channel to make the selection

                          Go back to layers

                          Create a black layer below the image

                          Delete the selection

                           

                          Job done.

                           

                          I just tried this and got crisp edges and everything looked fine to me.

                           

                          Or am I missing something? (that is not meant to sound sarcastic).

                           

                          Cheers

                           

                          John

                          • 10. Re: alpha channels
                            Nathan_Chestnut2 Level 1

                            Guys

                             

                            Thank you all very much for your input

                             

                            Using the blue channel was the way forward and end result is near perfect

                            • 11. Re: alpha channels
                              JJMack Most Valuable Participant

                              The way I did it was to select the layers transparency.  Use a large black brush and painted over the gradient so all selected pixels became 100% opaque. Then I deselected and selected painted in layers transparency. Converted the selection into a vector path and defined a custom shape.  Now you can have any solid color and size you want using custom shape tool set to pixels.

                              Capture.jpg

                              Also make shape layer with layer style added

                              Capture.jpg

                              • 12. Re: alpha channels
                                Trevor.Dennis Adobe Community Professional (Moderator)

                                I think Nathan moved the goal posts with this one when he mentioned taking it to Illustrator, because if that's where he needs the graphic, he doesn't need Photoshop.

                                 

                                [EDIT]  But that is a very nice version of the graphic at the end of your post JJ

                                • 13. Re: alpha channels
                                  c.pfaffenbichler Level 8

                                  Or am I missing something? (that is not meant to sound sarcastic).

                                  Indeed you did.

                                  The upper section is not solid.

                                  • 14. Re: alpha channels
                                    John_Picton Level 3

                                    Sorry I still dont get the problem.

                                     

                                    You said that the upper section is not solid - It appears to be fine to me.

                                     

                                    This is what I ended up with using the method I suggested. To my reading of the OPs first post this is what they wanted to do.

                                     

                                    Untitled-1.jpg

                                    • 15. Re: alpha channels
                                      c.pfaffenbichler Level 8

                                      You said that the upper section is not solid - It appears to be fine to me.

                                      Do you not understand the term »solid« in the context of Photoshop Layers?

                                      If you used the unedited blue channel and the black layer is atop a white layer you seem to have omitted measureing the color in the lower and upper parts.

                                      editLayerMaskScr.jpg

                                      • 16. Re: alpha channels
                                        John_Picton Level 3

                                        Obviously I dont understand the term "Solid" in relation to layers.

                                         

                                        However what the OP wanted to do was to recreate the graphic in a solid Black colour.

                                         

                                        The method I used did just that. Perhaps I dont understand everything - but the result worked and surely in the end that is what is important?

                                         

                                        The .jpeg that I ended up with is Solid Black.

                                         

                                        More than one way to achieve most results in PS - this was mine.

                                        • 17. Re: alpha channels
                                          c.pfaffenbichler Level 8

                                          Use the blue channel to make the selection

                                          Go back to layers

                                          Create a black layer below the image

                                          Delete the selection

                                          The way you described it (using the blue channel as a selection) the upper parts would not be black but (as in the screenshot I posted) a dark gray.

                                          If on the other hand you used the Magic Wand Tool in the Blue Channel that probably would explain the inferior details.

                                          • 18. Re: alpha channels
                                            John_Picton Level 3

                                            I CTRL clicked on the Blue Chanel to make the selection - I didnt touch the Magic wand tool.

                                            • 19. Re: alpha channels
                                              c.pfaffenbichler Level 8

                                              Are you claiming that a blue value of 29 (in the top region) resulted in the same opacity as a blue value of 0 (in the lower region)?

                                              • 20. Re: alpha channels
                                                John_Picton Level 3

                                                All I am saying is that I switched to the channels tab, Ctrl clicked on the Blue Channel, went back to the main image, made sure that the layer below the image was Black, moved to the layer with the image on it, inverted the selection and pressed Delete.

                                                 

                                                I haven't looked at any values or anything (I never mentioned them).

                                                 

                                                I ended up with the result I posted. Have you tried it - it really did work. I am not "claiming" anything other than that the method produces a solid black image with crisp edges.

                                                • 21. Re: alpha channels
                                                  c.pfaffenbichler Level 8

                                                  I haven't looked at any values or anything (I never mentioned them).

                                                  If you load the channel as a Selection the values translate to transparency values.

                                                   

                                                  When I try to reproduce your procedure I get 0/0/0 in the lower setions but the upper ones have about 22/6/2.

                                                  Also the edges are spread less than in your jpg, so I suspect you did some additional operation you did not mention.

                                                  editLayerMaskScr3.jpg

                                                  • 22. Re: alpha channels
                                                    c.pfaffenbichler Level 8

                                                    Did you delete more than once for example?

                                                    • 23. Re: alpha channels
                                                      John_Picton Level 3

                                                      I have just been through the process again to check (I realise that sometimes we complete steps unconciously). But no it was exactly as I described.

                                                       

                                                      I have just done a video of the process - I didnt annotate it but on the channels layer it is Ctrl left click on the Blue Channel, and when the contents of the selection are deleted I pressed Delete once (followed by Ctrl + D to deselect).

                                                       

                                                      http://www.youtube.com/watch?v=oxYP_Rq9pag

                                                      • 24. Re: alpha channels
                                                        John_Picton Level 3

                                                        Incidentally - in going through it again I realized that there is an even quicker way!

                                                         

                                                        You dont need to create a black background layer first.

                                                         

                                                        When you get to the stage that you are on the layer and it is selected (IE after the ctrl clicking in the Blue Channel) you just need to go to the edit menu and select fill and black and it will fill the selection in black achieving the same result.

                                                         

                                                        One step less.

                                                         

                                                        Cheers

                                                         

                                                        John

                                                        • 25. Re: alpha channels
                                                          c.pfaffenbichler Level 8

                                                          Thanks for the video.

                                                          But it shows that there is a difference. (the image is a screenshot of the video pasted in photoshop)

                                                          editLayerMaskVidScr.jpg

                                                           

                                                          And a, in my opinion, more reasonable way is using the Selection as a Layer Mask on a Solid Color Layer and not fill or delete on the original image Layer, but hide it completely, so as to avoid creating edge pixels that are actually a mixture of the original color and black.

                                                          • 26. Re: alpha channels
                                                            John_Picton Level 3

                                                            I completely see your point about using the selection as a layer mask instead of deleting the selection - and I agree that it is likely to produce better edges.

                                                             

                                                            Also promoting the selection to a new layer and then applying a layer style (color overlay) works.

                                                             

                                                            As I said - more than one way to do this!

                                                             

                                                            Cheers

                                                             

                                                            John

                                                            • 27. Re: alpha channels
                                                              c.pfaffenbichler Level 8

                                                              All this does not change the fact that using the blue channel as a Selection or Layer Mask still warrants some editing because the upper areas are not fully black so there would be some unwanted transparency.

                                                              And your video shows this.

                                                              editLayerMaskVidScr2.jpg

                                                              The image in post 14 does not show this effect, therefore I suspect it was produced slightly differently.

                                                               

                                                              But this is academic as the technique you proposed was good enough for the original poster’s purposes.

                                                              • 28. Re: alpha channels
                                                                John_Picton Level 3

                                                                I am sorry that you suspect that it was produced differently. I dont understand why you think I am trying to fool you.

                                                                 

                                                                It was produced EXACTLY like I described to you - I even posted a video of the process - If you dont believe me then perhaps you should learn to live with it!

                                                                 

                                                                The only other thing that happened was that it was saved out as a .jpeg.

                                                                 

                                                                As you said the OP was happy with the method I used. Perhaps you should stop trying to complicate things!!!

                                                                 

                                                                I am always eager to learn new techniques and - believe it or not - I was really pleased to read your suggestion of using the selection as a mask. What I dont appreciate is the constant suggestions that - for some reason that is completely beyond my comprehension - I am trying to suggest one technique whilst doing something different. I just dont get it!!

                                                                • 29. Re: alpha channels
                                                                  Trevor.Dennis Adobe Community Professional (Moderator)

                                                                  Wow, this thread has got some legs.  So after all that, my initial method of selecting the white background (it samples as 255, 255, 255 everywhere I checked) and inverting that selection, gives a quicker, more solid shape, (if turning the selection into a path and then a Solid Fill layer.

                                                                   

                                                                  In fact I was being overcautious even with a tolerance of 5, and 2 would have done the job.

                                                                   

                                                                  But as I mentioned in post #1012, the OP went on to ask about taking the graphic back into Illustrator.  I may be new to that app, but ISTM using the Illustrator Trace command followed by Simplify, puts what the OP wants where he wants it.  I just tried it (always test) and the graphic is so clean, that Trace produces nice smooth curves and sharp corners even without using Simplfy.  But I am a babe-in-the-woods with Illustrator, so might be getting it completely wrong.

                                                                   

                                                                  OK.  Ding ding...  Seconds out...  Round two

                                                                  • 30. Re: alpha channels
                                                                    c.pfaffenbichler Level 8
                                                                    It was produced EXACTLY like I described to you - I even posted a video of the process - If you dont believe me then perhaps you should learn to live with it!

                                                                    But the video clearly shows a different result than the jpg. (see screenshot in post 27)

                                                                    If you have saved the file you created in the video please measure the upper and lower black regions with the eyedropper tool – are they both 0/0/0?

                                                                    If not then there is a difference to the jpg from post 14 and the upper part is only partially deleted – as is to be expected because the forms in the blue channel show a slight gradiant.

                                                                     

                                                                    Perhaps you should stop trying to complicate things!!!

                                                                    I will stop the email notifications for this thread.