What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

A challenge to divide up image sections... ideas?


Clutch Cargo

Member
Messages
21
Likes
1
You guys have been so helpful to me solving problems/suggesting ideas that I thought I would put forth this issue. I am trying to discover a way to divide up sections of an image (not to be confused with "slices"). So the first screenshot shows the before shot. Solid areas of black (this is actually how they could be - simple black on white), in all different types of sizes and shapes.

What I would like to find is an automatic (thinking macro or scripts down the road) to divide the various "blotches" into smaller "blotches" :) You may have notice on the large blotch the center part was removed as well as divided up.

Any ideas on how to attempt this?
 

Attachments

  • Divide before.jpg
    Divide before.jpg
    28.3 KB · Views: 26
  • Divide after.jpg
    Divide after.jpg
    48.5 KB · Views: 26
Ok, as I keep working on this I have come up with this so far:

1. Using magic wand I select one, then SELECT/SIMILAR.
2. Then EDIT/STROKE and put in a random number for now of 50px, LOCATION was Inside (chose red just to show difference)
and this is what I got. On the way it looks like.

Now if I could chop up those lines into pieces.... first I am think of making some sort of hatch (cris-cross) type pattern and overlay it with that. But now I am thinking is there some way to tell PS this is a path and need to be "sliced" or cut along the path at certain intervals? Thinking out loud here.
 

Attachments

  • Divide using stroke.jpg
    Divide using stroke.jpg
    51.9 KB · Views: 25
I'm a bit lost, Clutch. For example, I can think of several mathematical algorithms that would do what you said, but I suspect that none of them would be what you want because there are more constraints on the problem.

Perhaps, if can you give some real-world context to what you want, or give a more complete example, we'll get a better idea.

Tom

PS - Google {"tiling of a plane"} to see one of the general class of mathematical problems that might be applicable. The more specialized, {"voronoi tessellation"}, e.g. http://bl.ocks.org/mbostock/4060366 might be even more directly applicable as one could produce a series of tessellations with successively more points that would be similar to your request to "divide it into smaller blotches".
 
Ok, this should give you a better idea. Think of the image as a top down map of a town. Each divided black spot is a house plot.

I am researching on the tiling a plane as you suggest.
 

Attachments

  • top down.jpg
    top down.jpg
    76.3 KB · Views: 26
You guys have been so helpful to me solving problems/suggesting ideas that I thought I would put forth this issue. I am trying to discover a way to divide up sections of an image (not to be confused with "slices"). So the first screenshot shows the before shot. Solid areas of black (this is actually how they could be - simple black on white), in all different types of sizes and shapes.

What I would like to find is an automatic (thinking macro or scripts down the road) to divide the various "blotches" into smaller "blotches" :) You may have notice on the large blotch the center part was removed as well as divided up.

Any ideas on how to attempt this?


I used to work in an architectural firm and needed to do something like this.

Unfortunately, PS at the time can't do that. And I don't know of any way in the current PS to do it either - script or otherwise.

Most especially if what you're working on is an aerial/satellite shot. There's just to much detail or variables for even a script or macro to single out

Unless there's something in the new CC that cover this.......
 
This may not be suitable for all your requirements but how about stroking a path with a brush:(+ spacing), pattern or dashed line?

I appreciate this may not be totally successful for all those objects but the one on the left could certainly be 'broken up', (created), using this method.

At least that would get you half-way there.

Regards.
MrTom.

PS. Didn't go into detail in-case this is just not an option.
 
No, it's definitely worth a try...

Ok, like I said this may not be an entirely viable solution but...
Done with PS CC in Windows...adjust to taste:

Create a path:
stroke_path_01.png

How you do this depends on what you have to work with but it could be via a Converted Selection, Pen Tool, Shape Tool, whatever.
If you do this via the 'Shape' tool it becomes a 'Live' shape which means that it will have 'properties' in the properties panel, (Window > Properties).

If you convert a selection or use the 'Pen' tool then the properties panel will be virtually empty BUT the same properties are also made available at the top of the window...
stroke_path_04.png

Also NOTE: If you do use the 'Pen' tool make sure it is set to 'Shape' NOT path....then you'll have the stroke options.

You can choose what type of stroke you want from this dropdown next to the 'Width' type-in:
stroke_path_02.png

Note you can change the 'Dash' and 'Gap' properties,(and add 2 more if you wish), with these and also the stroke width setting you can quickly get a stroke to look something like this:
stroke_path_03.png

Now, this may take a while to get right and will probably be very much 'trial and error' but being 'Live' it changes on-the-fly, which makes it a little quicker.
From the fly-out, (the small cog icon top right of the Stroke Options panel), you can save any custom 'dashed' lines you create for later use.

Instead of a solid line, dashed line or brush you can also use a 'pattern':
stroke_path_05.png

You can make your own 'pattern' and use it for fill, stroke, brushes etc.....here I have made a custom 'Graph Paper' pattern, used it in the stroke option and also set it to stroke the 'outside' of the path.

You can also move and/or change the shape of a 'Live' shape as long as you created it using the 'Pen' tool and the 'stroke will update automatically....although then your spacings may need changing to suit.

Trying to change, (edit), a predefined shape, (as in rectangle tool, elipse tool, polygon tool or custom shape), will result in a warning that it will no longer be a 'Live' shape....I got this a couple of times but didn't explore it fully so couldn't guarantee this is exactly correct...you'll see if you try it.

If you lose the path you can always select it again from the 'Paths' palette.

There are many many different things to play with on this, far too much to explain really, even these basics could keep you busy for a couple of hours.

Best thing is to play around with it....you never know what may happen!

Regards.
MrTom.
 
I see what you are doing and was able to create something similar. But you used the pen tool to create a path. My objects (for lack of the proper term), are already created above. Is there a way to select those, make them the vector path ready to accept the dashed stroke? Is that what you meant by may not be suitable as I would have to first create the vector lines?

Thought I remember something like a "marque", but that may have been in Illustrator?
 
...Is there a way to select those, make them the vector path...

Several....(wouldn't ya know it!).

I don't know if each object is on its own layer or not but the process is the same regardless:

To make a selection BY PIXELS you can Ctrl + Click the layer THUMBNAIL.
Pixels below 50% transparency will NOT have 'marching ants' but are still included in the selection bounds....this is just how Adobe do it for some reason.

Using Shift or Alt with Ctrl will add or subtract from the selection by clicking other thumbnails....even if the layer is not selected.

OR

Manually make a selection using the 'Rectangular Marquee' tool or any other tool under that category.
If you do have each 'object' on its own layer you do not need to be precise with your marquee, as long as you surround the pixels in question that's enough...this is stage 1...

... stage 2, place your cursor inside the selection area (the cursor should get a rectangle next to it) and hold down Ctrl....the cursor should now have the scissors next to it)......now click and drag and the selection should conform to the pixels on that layer.....and within the selection area.

Which of these you do depends on if you can move the pixels on that layer or not but once you have your selection right click within the area and select 'Make Work Path'.....set the tolerance, 1.0 is good but really depends on the size of the selection area...and voila!

Selection to Work Path.

You may need to refine the path as it can be a little random sometimes but again it really depends on the size of the selection area you are converting.

Ctrl + Click is probably the easiest way to make a selection but just remember about the 50% thing....its easy to assume its not worked correctly when in fact it has.

Try that....or any variation of.

Regards.
MrTom.
 
As an update, I notice Illustrator has the same function so it may be easier to trace the black blotches into vectors then adjust thickness and add the dashes there. I'll mess with that for awhile to see what I come up with.
 
If Stroking a path solves your original question then yeah, create those paths by whatever method is easiest for you......I just wouldn't want you to go down this route if it doesn't ultimately solve your problem....ya know?

Good luck!

Regards.
MrTom.
 
Let me make sure I understand exactly what you want. Am I correct that:

a) you start with an aerial photo like #1, below;

b) put black shapes over either each house in the image, or each plot of land as shown in #2, below;

c) and then change the background to something undoubtedly a lot more complicated than the simple white background I show.


If so, I don't see why you need to introduce the extra step of starting the shape-making process with a larger shape representing each city block or group of houses.

T
 

Attachments

  • step_1.jpg
    step_1.jpg
    193 KB · Views: 11
  • step_2.jpg
    step_2.jpg
    190 KB · Views: 11
  • step_3.jpg
    step_3.jpg
    41.8 KB · Views: 11
It's been awhile since I have back to this thread so my apoligies to Tom if you are reading this. I was busy working on other sections of the project.

To answer you question Tom, the reason we start with a bigger shape it we are to automate the process of creating all the building shapes. In your example, you manually created the two house footprints I assume. So using you first image, I need to create a process to create each of those houses. Can't afford real-world footprint data, :cry:, as it would be so much easier. So we must create our own or at least approximate it. Image #3, yes it will end up being alot more complicate than just a white background but for creating the building footprints the B&W image is the easiest way to process.

Clutch
 

Back
Top