PhotoshopForums.com Home
Navigate Contact FAQ Search Members
Layer dilation issue
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> General Photoshop and Design Discussion
 See a User Guidelines violation? Please contact us.
Author Message

Nightshade

Joined: 12 Jan 2014
Posts: 1



PostPosted: Sun Jan 12, 2014 9:44 am    Post subject: Layer dilation issue Reply with quote

I'm trying to set up an automated workflow in Photoshop, and atm I'm stuck with the algoritm.

What I want to achieve:
I want to expand/dilate/grow/bleed each layer one pixel at a time - but only in the case where the area outside the layer is either black or transparent (either one works for me). It should look at the entire document and not just the active layer (although I am open to a solution where the end result is a flattened image. I can separate the colors with a script)

What I've tried:
Various types of blurring and clamping (using for instance, a Levels layer to clamp away the gradient), blurring and posterizing.
I've tried flattening the image, selecting all the padding (black pixels), filled with Content Aware -fill and posterized it back to 2 levels (this results in a jagged edge). I've tried a lot and the thing that gets the closest to what I want to achieve is the "Minimum" filter under "Filter > Other"
I've also tried various select/deselect/intersection algoritms and although these work, they are very slow. In the end I might end up running this operation up to 512 times so having a 10-step selection algoritm that fills and deletes color in the layers is going to be VERY slow.

Problem:
In a composite image, the Minimum filter will eat away the black - just as I want - but it will also blend colors (which I DON'T want).
So for example, a blue area and a red area separated by a 1px row of black will result in the black line turning magenta if I run "Minimum" 1px on it - because the red and the blue blends together.

And if I separate each color into individual layers - as in the workfile below - then there is another issue. Sure I can run Minimum 1px at each layer - one at a time - but then the layer order screws things over, with the top layer occupying more pixels than it should, bleeding over onto other color layers.

You see the problem here? I want to expand out each layer and want them to meet half-ways - eating away either black or transparent pixels - not grow over each other or blend pixels. I've looked at the Custom filter for this but can't come up with a solution that doesn't blend pixels.
This did sound like an easy problem at first but damn this is really starting to annoy me.


Example workfile:
http://www.speedyshare.com/nJESB/example.psd
(press the download link text at the top)
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> General Photoshop and Design Discussion All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Contact - User Guidelines >

Copyright © 2003-2016. PhotoshopForums.com, iFroggy Network. All Rights Reserved.
Powered by phpBB © phpBB Group. phpBB SEO. Privacy Policy.
We are in no way affiliated with Adobe. Photoshop, Adobe and related marks are registered trademarks of Adobe.
PhotoshopForums.com