Jump to content
You must now use your email address to sign in [click for more info] ×

How to select a cat's whiskers?


Recommended Posts

I can't select my cat's whiskers shown below which lie outside of the selection.  I used selection refinement matting, and painted over them after selecting the foreground button.  But it doesn't select them I believe due to the lack of contrast.  Is there any technique I could use to select these whiskers?

-Thanks

 

image.png.14600b679c1bef171aeebbb2acf66ad5.png

Link to comment
Share on other sites

  1. Duplicate the layer
  2. Select the selective colour adjustment filter
  3. Select neutral from the dropdown and slide the Black slider to the far right (100%) and click Merge
  4. Now use that layer to make a selection of the cat and it's whiskers

This is the result I got using the method above, could be a bit better but passable for a quick job.
image.png.920a715774ff562d5a904a701294036e.png

You could also try using Brightness and Contrast, Levels or Curves to try and make the whiskers darker and lighter where the light catches them.

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

... or if the background isn't too noisy, (adjusted) frequency separation and masking on the high pass layer could be a quick'n'easy solution, too.

»A designer's job is to improve the general quality of life. In fact, it's the only reason for our existence.«
Paul Rand (1914-1996)

Link to comment
Share on other sites

Since the background and the cat's whiskers go partly tone in tone here, you wouldn't be able to do a perfect selection, especially not with default APh selections on the base image. Thus the best way here would probably be to create another second layer (as firstdefence said), alter the duplicate second layer image to give more of a differentiate between contrasty grayscale tones and then try to perform a better selection and refinement on that one. ...

image_cat.jpg.be84f410fc2fc80694fa0dc800c3081d.jpg

Afterwards take the selection over to your initial main layer and perform an extraction.

Next time when you photograph your cat, take the background urgently into account, place the cat in front of some even different colored background, so all nuances of your cat (like the whiskers too) do stand out clearly from the background.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

The main challenge is that the hairs are partially black, partially white, and match the background color.

So every contrast based selection method does not lead to good results (or you may have a phased approach handling black / grey / white parts of hairs)

Alternative method for perfectionists:

  1. use the Node Tool
  2. set fill to none
  3. set stroke to 2 pixel in white
  4. cover every hair with an individual stroke.
  5. group all pen curves
  6. select all pen curves; adjust stroke "pressure" and reduce it at the ends to 1/2.
  7. merge visible and rasterize to mask.

Second Alternative:

  1. Draw new hairs with pen tool instead of masking

image.png.ed9f5b19d8ed785e879418cd7573e7f1.png

Image shows green fill layer behind mask

 

image.thumb.png.e3a6d80c11339dc34c3dd50cc2a4bd9b.png

 

image.png.0e42b5b6ff73e8b90bef04bb3720bf38.png

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

16 hours ago, firstdefence said:
  1. Duplicate the layer
  2. Select the selective colour adjustment filter
  3. Select neutral from the dropdown and slide the Black slider to the far right (100%) and click Merge
  4. Now use that layer to make a selection of the cat and it's whiskers

This is the result I got using the method above, could be a bit better but passable for a quick job.
image.png.920a715774ff562d5a904a701294036e.png

You could also try using Brightness and Contrast, Levels or Curves to try and make the whiskers darker and lighter where the light catches them.

 

Thanks,  I will give that a try.

Link to comment
Share on other sites

11 hours ago, v_kyr said:

Since the background and the cat's whiskers go partly tone in tone here, you wouldn't be able to do a perfect selection, especially not with default APh selections on the base image. Thus the best way here would probably be to create another second layer (as firstdefence said), alter the duplicate second layer image to give more of a differentiate between contrasty grayscale tones and then try to perform a better selection and refinement on that one. ...

image_cat.jpg.be84f410fc2fc80694fa0dc800c3081d.jpg

Afterwards take the selection over to your initial main layer and perform an extraction.

Next time when you photograph your cat, take the background urgently into account, place the cat in front of some even different colored background, so all nuances of your cat (like the whiskers too) do stand out clearly from the background.

 

 

Thanks, I'll also give that a try.

Link to comment
Share on other sites

11 hours ago, NotMyFault said:

The main challenge is that the hairs are partially black, partially white, and match the background color.

So every contrast based selection method does not lead to good results (or you may have a phased approach handling black / grey / white parts of hairs)

Alternative method for perfectionists:

  1. use the Node Tool
  2. set fill to none
  3. set stroke to 2 pixel in white
  4. cover every hair with an individual stroke.
  5. group all pen curves
  6. select all pen curves; adjust stroke "pressure" and reduce it at the ends to 1/2.
  7. merge visible and rasterize to mask.

Second Alternative:

  1. Draw new hairs with pen tool instead of masking

image.png.ed9f5b19d8ed785e879418cd7573e7f1.png

Image shows green fill layer behind mask

 

image.thumb.png.e3a6d80c11339dc34c3dd50cc2a4bd9b.png

 

image.png.0e42b5b6ff73e8b90bef04bb3720bf38.png

 

Thanks, I tried and failed using the pen tool.  I will certainly give this a try with the node tool.

Link to comment
Share on other sites

11 hours ago, v_kyr said:

Since the background and the cat's whiskers go partly tone in tone here, you wouldn't be able to do a perfect selection, especially not with default APh selections on the base image. Thus the best way here would probably be to create another second layer (as firstdefence said), alter the duplicate second layer image to give more of a differentiate between contrasty grayscale tones and then try to perform a better selection and refinement on that one. ...

image_cat.jpg.be84f410fc2fc80694fa0dc800c3081d.jpg

Afterwards take the selection over to your initial main layer and perform an extraction.

Next time when you photograph your cat, take the background urgently into account, place the cat in front of some even different colored background, so all nuances of your cat (like the whiskers too) do stand out clearly from the background.

 

 

BTW, this photograph of my cat was spontaneous.  I was heading outside to practice with my new Sony 200-600mm lens, when Beau peaked at me from around the corner.

Link to comment
Share on other sites

12 hours ago, NotMyFault said:

The main challenge is that the hairs are partially black, partially white, and match the background color.

So every contrast based selection method does not lead to good results (or you may have a phased approach handling black / grey / white parts of hairs)

Alternative method for perfectionists:

  1. use the Node Tool
  2. set fill to none
  3. set stroke to 2 pixel in white
  4. cover every hair with an individual stroke.
  5. group all pen curves
  6. select all pen curves; adjust stroke "pressure" and reduce it at the ends to 1/2.
  7. merge visible and rasterize to mask.

Second Alternative:

  1. Draw new hairs with pen tool instead of masking

image.png.ed9f5b19d8ed785e879418cd7573e7f1.png

Image shows green fill layer behind mask

 

image.thumb.png.e3a6d80c11339dc34c3dd50cc2a4bd9b.png

 

image.png.0e42b5b6ff73e8b90bef04bb3720bf38.png

 

When I select a whisker, then convert it to a mask, it closes the vector curve and I wind up with a selection like in the second screenshot below.  I'm trying to select each individual whisker with the pen tool, and convert it to a selection.   Is that possible?

-Thanks

image.png.86a7aff39d427aba9963a4962fa88996.png

image.png.1a7850dc249b66d5d708dbe701185145.png

Link to comment
Share on other sites

It's possible to convert a curve into selection in Photo, but probably too complicated to do for all whiskers in this case. - Try instead to zoom in to a high zoom level and use an appropriate sized selection brush in add to selection mode.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

7 hours ago, zBernie said:

 

When I select a whisker, then convert it to a mask, it closes the vector curve and I wind up with a selection like in the second screenshot below.  I'm trying to select each individual whisker with the pen tool, and convert it to a selection.   Is that possible?

-Thanks

 

 

Hi, 

i forgot to mention:

please check Line Mode. The 4 Modes are on the right side in the toolbar. Line mode is the last of the 4.

 

40F484ED-5126-45C3-9331-E07AFC3AA2C6.jpeg

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

6 hours ago, v_kyr said:

It's possible to convert a curve into selection in Photo, but probably too complicated to do for all whiskers in this case. - Try instead to zoom in to a high zoom level and use an appropriate sized selection brush in add to selection mode.

Why do you think it is too complicated?

just group all curves, rasterize to mask. 
you could even use the group of curves directly for masking.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

18 hours ago, NotMyFault said:

Why do you think it is too complicated?

just group all curves, rasterize to mask. 
you could even use the group of curves directly for masking.

I used the line mode as you suggested.  I outlined two whiskers, then grouped them.  Then right clicked on the group and selected "Rasterize to Mask".  I wind up with what is shown in the screenshot below, and the cat is no longer visible.  How can this translate into selecting the whiskers with the pen tool?

-Thanks

 

image.png.2ca3bfcaa202427beb10bfba6480bacb.png

Link to comment
Share on other sites

3 hours ago, zBernie said:

I used the line mode as you suggested.  I outlined two whiskers, then grouped them.  Then right clicked on the group and selected "Rasterize to Mask".  I wind up with what is shown in the screenshot below, and the cat is no longer visible.  How can this translate into selecting the whiskers with the pen tool?

-Thanks

 

 

Hi,

there are may ways to combine two masks / selections, using different techniques:

  • Deactivate the mask layer, all becomes visible again
  • Select the Background layer
  • Use the selection tool to select the cat (don’t care about  the whiskers)
  • select the mask layer
  • use the brush tool, color white, large brush, and paint over the cat inside the mask
  • deselect all
  • activate the mask layer

Voila, the cat should be visible again.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.