[Closed] more control for Edit > Select Picture Content?

Want to submit a new feature, an enhancement ? Do it here !
Post Reply
mathematrucker
Posts: 5
Joined: Wed Jul 29, 2009 4:50 pm

[Closed] more control for Edit > Select Picture Content?

Post by mathematrucker »

First let me begin with my usual disclaimer: I am not a power user---neither a graphics expert in general, nor a GC expert in particular---so it's possible I am simply lacking some basic information on the subject of Edit > Select Picture Content (SPC).

Quick aside: there may be a small possible error in the manual, for I read somewhere that as of version 9.1 SPC became a batch step...Crop Content is easy to find, but I could not find any SPC batch step anywhere (in either 9 or 10).

I wish there was a setting in the Preferences for the tolerance level of SPC. It might not solve my present problem, but it would surely be nice to have.

Here's my present problem:

I have a large number (>2000) of pdf pages with varying margins. In order to present these pages in a uniform manner I need to get the current margin data for later conversion. Happily, GC provides an easy way to do this:

Using keyboard-macro software (Keyboard Maestro),

1. Perform SPC.
2. Double-click the Selection Tool in the Toolbox to get the Selection window.
3. Paste the four data values into a text file containing other page data.

The only thing that is not working as well as hoped, is the initial SPC often gets hung up on tiny specks near the content. Whenever this happens I have to manually slide the selection frame in a bit to get across the invisible speck, then SPC again. The specks must be very tiny ones, because the second try almost always works.

Any suggestions on a workaround? Is there some batch action I could perform on the files that would give the SPC a better chance of ignoring tiny specks? Having to manually slide and re-SPC really slows things down a lot.
mathematrucker
Posts: 5
Joined: Wed Jul 29, 2009 4:50 pm

Re: more control for Edit > Select Picture Content?

Post by mathematrucker »

Think I found a good workaround. It worked well for a test page. Even if this solution can't be batched using GC, it's something that can be automated by Keyboard Maestro before the first SPC is attempted.

The solution is to click the Magic Pen anywhere in the margin with the tolerance set at 220 then do Edit > Fill Selection with Foreground Color (with the foreground color obviously set to match the margin color). This worked like a charm for my test page and I'm pretty sure it'll work for any page.

So long as the Magic Pen leaves the majority of the content untouched, the higher the tolerance the better. Setting it at 255 just selects the whole page, so it has to be lower than that, but I'm optimistic that there is probably some tolerance that will completely solve the problem for every page. 220 might be it, but I'll try raising it to see what happens.
mathematrucker
Posts: 5
Joined: Wed Jul 29, 2009 4:50 pm

Re: more control for Edit > Select Picture Content?

Post by mathematrucker »

Turns out that wasn't the right solution after all. For some reason today I can't replicate what seemed to work yesterday.

But no matter. This morning I (finally) discovered that Effect/Despeckle should work. Doing this first before selecting the content appears to get rid of all those "invisible" specks around the content, thus allowing accurate margin data to be gathered.
mathematrucker
Posts: 5
Joined: Wed Jul 29, 2009 4:50 pm

Re: more control for Edit > Select Picture Content?

Post by mathematrucker »

Ack, Despeckle doesn't work consistently either. Seems coincidentally odd that both solutions worked on the first pages I tried, then not on any others I tried after that. Perhaps my goal of automatically erasing all specks in the margin requires an AI beyond what humans have yet devised.
mathematrucker
Posts: 5
Joined: Wed Jul 29, 2009 4:50 pm

Re: more control for Edit > Select Picture Content?

Post by mathematrucker »

Further online research has led me to the concepts of erosion specifically and morphology in general. Erosion is what I need---the idea is to erode away the black specks in the margin while leaving enough of the content to preserve the original margin sizes.

Words like "erosion" and "morphology" don't appear anywhere in the GC manual, but I think I found a two-step way to implement something equivalent to erosion in GC: perform a disc blur, then apply my first solution above---select the margins with the Magic Pen, then apply Edit/Fill Selection with Foreground Color. This method appears to be the magic bullet I was looking for.
Post Reply