I know Visio can trace the outline of an object in an image using the Arc, Freeform, and Pencil tools. I have used it before so I could calculate the area of an irregular shape. But can it cut irregular shapes out of a photo like shown in this video about Photoshop?
https://www.youtube.com/watch?v=VsSjXNOE7NM
Perhaps I was not using these tools correctly, but it was much more difficult to get as close to the edges as the guy does in that video. Is there an similar online tutorial for Visio?
Not sure I totally understand the question.
Visio will not do a cutout. That is most easily done in a photoediting app. So, if that's the question, answer is no.
Visio will draw. Which as you know, allows you to make outlines of a shape. Is there a tutorial? Not that I'm aware of. The video makes some good points...didn't watch all of it...and Visio can do most/all, except cut.
I found the drawing tools work well. You can almost use line and pencil tools exclusively. Basically, draw a line between two points on a curve, add an inflection point as needed, and drag it to trace the shape. Add inflection points to refine the curve. Repeat as you proceed around the shape. The curve tool is handy for simple curves, but, line and pencil work equally well. I RARELY use the free form tool. It is too detailed. My preference.
For example of complex tracing, see http://visguy.com/vgforum/index.php?topic=586.msg2496#msg2496 (http://visguy.com/vgforum/index.php?topic=586.msg2496#msg2496).
The two instrument shapes were tracing based on pix of the guitar and bass.
Another trip back in time...
Saw this 2014 post you made, http://visguy.com/vgforum/index.php?topic=6194.msg25243#msg25243 (http://visguy.com/vgforum/index.php?topic=6194.msg25243#msg25243). That piqued my curiousity. So, I agree, with newer versions of Visio, it is NOT as easy as it was, and, as i'm using 2019, either the change seems to be here.
But, all is not lost. The arc tool is usable. It may be necessary to zoom in on the inflection point and use pencil tool to grab the curve deflection points.
Quote from: wapperdude on May 07, 2023, 08:29:16 PM
Not sure I totally understand the question.
Visio will not do a cutout. That is most easily done in a photoediting app. So, if that's the question, answer is no.
Doing a cutout in the whole point, so I guess Visio is out. Seems like a fairly simple feature to add.
1) Open a new page
2) copy your group of shapes
3) paste special in a new page as bit map or whatever
4) draw a line over the image where you want to cut (straight like or a path)
5) select the image and line
6) Goto drawing operations in developer mode and select fragment
7) take the part you want and use it
Note this results in a static bit map image..not visio editable set of shapes.
The problem with fragment is that is destroys the contents. Here's a quick demo.
(https://i.postimg.cc/d34tq5LC/image.png)
Is there any way to do the fragment and preserve the image? If so, that might just solve my problem.
Not that I'm aware of.
Visio does not preserve content of imported image file after fragment operation..or most (all?) similar operations that involve filled content. If it is possible, I'd like to know too.
Did google search for photo to jigsaw... quite a few options.
NOT tried any.
This looks interesting from price standpoint: https://www.epuzzle.info/en/puzzle-from-photo (https://www.epuzzle.info/en/puzzle-from-photo)
Quote from: wapperdude on May 08, 2023, 03:25:46 PM
Not that I'm aware of.
Visio does not preserve content of imported image file after fragment operation..or most (all?) similar operations that involve filled content. If it is possible, I'd like to know too.
When I was creating that example above, I first tried it with a filled shape. Fragment sorta preserves the content there. 🤨🤔🙄
(https://i.postimg.cc/4355cNJV/image.png)
That would not work for what I need.
I'd like to know what the (il)logic is behind the current Fragment behavior. Makes no sense to me.
That result is unexpected. That is not a "true" fragment. What this looks like the original shape had a radial fill pattern and when it was fragmented, each piece retained the full radial fill definition. That actually makes some sense, from a simple implementation perspective. That is, the shape had as its fill a centered, radial pattern. So, each fragment gets that same definition, including all the coloring characteristics. Not treated as bitmap slice and dice. Definitely not useful for jigsaw puzzle design.
Quote from: wapperdude on May 08, 2023, 06:28:13 PM
That result is unexpected. That is not a "true" fragment. What this looks like the original shape had a radial fill pattern and when it was fragmented, each piece retained the full radial fill definition. That actually makes some sense, from a simple implementation perspective. That is, the shape had as its fill a centered, radial pattern. So, each fragment gets that same definition, including all the coloring characteristics. Not treated as bitmap slice and dice. Definitely not useful for jigsaw puzzle design.
Yup. When I converted the image to an external image, Fragent killed the image.
(https://i.postimg.cc/FRQmDN5G/image.png)
I guess you copy and paste as an image and use cropping to do what you want
You can do the desired type of fragmenting in Power Point. For a demonstration, see this video: https://m.youtube.com/watch?v=d-Ij3ZtIxHU (https://m.youtube.com/watch?v=d-Ij3ZtIxHU).
Quote from: wapperdude on May 09, 2023, 11:13:28 PM
You can do the desired type of fragmenting in Power Point. For a demonstration, see this video: https://m.youtube.com/watch?v=d-Ij3ZtIxHU (https://m.youtube.com/watch?v=d-Ij3ZtIxHU).
Ok, thanks. I'll check it out.
Quote from: wapperdude on May 08, 2023, 03:47:01 PM
Did google search for photo to jigsaw... quite a few options.
NOT tried any.
This looks interesting from price standpoint: https://www.epuzzle.info/en/puzzle-from-photo (https://www.epuzzle.info/en/puzzle-from-photo)
Ok, thanks
Just a followup...here's link to Affinity Designer 2 showing cutting (fragment): https://affinity.help/designer2/English.lproj/index.html?page=pages/ObjectControl/cutting.html?title=Cutting%20objects (https://affinity.help/designer2/English.lproj/index.html?page=pages/ObjectControl/cutting.html?title=Cutting%20objects)
Less expensive than Photoshop I believe.
Quote from: wapperdude on May 10, 2023, 04:44:17 PM
Just a followup...here's link to Affinity Designer 2 showing cutting (fragment): https://affinity.help/designer2/English.lproj/index.html?page=pages/ObjectControl/cutting.html?title=Cutting%20objects (https://affinity.help/designer2/English.lproj/index.html?page=pages/ObjectControl/cutting.html?title=Cutting%20objects)
Less expensive than Photoshop I believe.
Thank you
To be honest I wouldn't know how to do it in Photoshop.
But here is a solution in Visio.
Key is the cell "ClippingPath". It allows to define an outer curve for an image shape.
https://learn.microsoft.com/en-us/office/client-developer/visio/clippingpath-cell-foreign-image-info-section (https://learn.microsoft.com/en-us/office/client-developer/visio/clippingpath-cell-foreign-image-info-section)
With a little automation you can select the image shape, then the jigsaw shapes.
Then the macro copies the geometry section of each jigsaw shape into a copy of the image shape and assigns the clippingPath cell to the newly imported geometry section.
Done.
Option Explicit
Private Sub cmProcess_Click()
Dim frameShp As Shape
Dim frameShp2 As Shape
Dim picShp As Shape
Dim picShp2 As Shape
Dim JSshp As Shape
Dim JSshp2 As Shape
Dim JSshp3 As Shape
Dim sel As Selection
Dim arShpIDs As Variant
Dim vShpID As Variant
Dim x1 As Double
Dim y1 As Double
Dim x2 As Double
Dim y2 As Double
Set picShp = ActivePage.Shapes.ItemFromID(tPic.Value)
getExtends picShp, x1, y1, x2, y2
Set frameShp = ActivePage.DrawRectangle(x1, y1, x2, y2)
arShpIDs = Split(tShapes.Value, ";")
For Each vShpID In arShpIDs
Set JSshp = ActivePage.Shapes.ItemFromID(vShpID)
Set JSshp2 = duplicateInPlace(JSshp, "JigSawShape2")
Set frameShp2 = duplicateInPlace(frameShp, "Frame2")
Set picShp2 = duplicateInPlace(picShp, "PicShape2")
ActiveWindow.DeselectAll
ActiveWindow.Select frameShp2, visSelect
ActiveWindow.Select JSshp2, visSelect
ActiveWindow.Selection.Join
Set JSshp3 = ActivePage.Shapes.Item(ActivePage.Shapes.Count)
JSshp3.Name = "JigSawShape3"
picShp2.AddSection visSectionFirstComponent + 1
picShp2.AddRow visSectionFirstComponent + 1, visRowComponent, visTagComponent
Dim row_ As Integer
Dim col_ As Integer
Dim rowType_ As Integer
For row_ = 1 To JSshp3.RowCount(visSectionFirstComponent)
rowType_ = JSshp3.rowType(visSectionFirstComponent, row_)
picShp2.AddRow visSectionFirstComponent + 1, row_, rowType_
For col_ = 0 To JSshp3.RowsCellCount(visSectionFirstComponent, row_) - 1
picShp2.CellsSRC(visSectionFirstComponent + 1, row_, col_).Formula = JSshp3.CellsSRC(visSectionFirstComponent, row_, col_).Formula
Next col_
Next row_
picShp2.Cells("ClippingPath").Formula = Chr(34) & "Geometry2.path" & Chr(34)
picShp2.Cells("pinx").Formula = picShp2.Cells("pinx").ResultIU + picShp2.Cells("width").ResultIU + 2
JSshp3.Delete
Next vShpID
frameShp.Delete
End Sub
Function duplicateInPlace(shp As Shape, Optional ShapeName As Variant) As Shape
Dim shp2 As Shape
Set shp2 = shp.Duplicate
shp2.Cells("pinx").Formula = shp.Cells("pinx").ResultIU
shp2.Cells("piny").Formula = shp.Cells("piny").ResultIU
If Not IsMissing(ShapeName) Then
shp2.Name = ShapeName
End If
Set duplicateInPlace = shp2
End Function
Private Sub cmSelPic_Click()
If ActiveWindow.Selection.Count <> 1 Then
MsgBox "Please select one picture shape.", vbOKOnly
Exit Sub
End If
tPic.Value = ActiveWindow.Selection(1).ID
End Sub
Private Sub cmSelShapes_Click()
Dim shp As Shape
Dim temp As String
For Each shp In ActiveWindow.Selection
temp = temp & shp.ID & ";"
Next shp
If Right(temp, 1) = ";" Then
temp = Left(temp, Len(temp) - 1)
End If
tShapes.Value = temp
End Sub
Sub getExtends(ByRef shp As Shape, ByRef x1 As Double, ByRef y1 As Double, ByRef x2 As Double, ByRef y2 As Double)
x1 = shp.Cells("pinx").ResultIU - shp.Cells("locpinx").ResultIU
x2 = x1 + shp.Cells("width").ResultIU
y1 = shp.Cells("piny").ResultIU - shp.Cells("locpiny").ResultIU
y2 = y1 + shp.Cells("height").ResultIU
End Sub
Downside, each new jigsaw shape has the size of the original shape. Got stuck on this one. May one of the peer members help?
And here the stencil with the macro.
Quote from: Yacine on May 10, 2023, 08:51:39 PM
And here the stencil with the macro.
Wow! That will take me a bit of time to get my head around...
Thanks
Quote from: Jennifer on May 10, 2023, 08:58:25 PM
Wow! That will take me a bit of time to get my head around...
No need to get your head around it.
Just start the form in the stencil (Open the VB editor and run the form).
Note - The jigsaw pieces must be placed on top of the image in order to work properly and at the right place.
Place you image, create the jigsaw pieces, move them over the image.
Start the form, select the image shape, click on first button to get its ID, then select all the jigsaw pieces, press the second button, then the 3rd one ("process").
The image shape may be hidden by all the jigsaw shapes. You can move one those shapes to the side to select the image, then move the jigsaw shape back to its position. Alternatively remove the fillings of the jigsaw shapes.
Quote from: Yacine on May 10, 2023, 09:04:44 PM
No need to get your head around it.
Just start the form in the stencil (Open the VB editor and run the form).
Ok, thanks
Can't this be solved with a bit of VBA?
Quote from: Visisthebest on May 11, 2023, 10:58:41 AM
Can't this be solved with a bit of VBA?
Do you mean cutting out pieces? If there is a VBA solution, I would love to know what it is. I don't have a clue as to how to do it.
@Yacine: not sure I get the point.
The OP wants to take a picture, foreign object if you will, and slice it to make a puzzle. Very simple objective. Visio, out-of-the-box, won't do that.
I admit, I haven't tried your code, but your comment about "original size" was, discouraging, unless I misunderstand.
PowerPoint and other non-stop programs appear to have solutions. Unfort, my version of PPt, is lacking key feature shown in videos, so I cannot verify. Nonetheless, all videos seem to indicate fairly straight forward, built-in solutions.
@Wapperdude
My sad face palm picture was because of Visisthebest's suggestion to use VBA without having read that I posted already such a solution. Anyway - we are nice people here, so I deleted it.
Regarding my solution, it is indeed not perfect yet. The cut shape looks as needed, but its boundaries are those of the big image.
That is why I asked whether someone else could have a look.
Please have a try.
Meanwhile a muse came flying by. I will try to crop the image first, without relying on the helper rectangle.
Rgds,
Y.
Quote from: wapperdude on May 11, 2023, 05:55:10 PM
Visio, out-of-the-box, won't do that.
And that's where Visio shines, why I love it so much. Having the possibility to implement a feature, that wasn't planed, one that belongs to another software group.
Awesome!
LOL.
I get the obvious point. Most of us have either witnessed it, even victim of it, or even guilty of it. I speak from experience. Many times, more than a forehead slap comes to mind as an appropriate response. "My tongue is numb!"
Cropping the image before assigning the ClippingPath worked fine.
PROBLEM: The clipping path seems to have issues with complicated NURBS rows. I don't know how to fix it.
You can compare the geometry sections of the original and the new shape. No difference, but other appearance.
So the tool is obviously limited to simpler shapes. Sorry.
And here the drawing and the updated stencil.
Yes sorry Yacine I did not read the entire forum thread through responded too quickly.
No, I'm sorry. ;D
After some fiddling around, I came up with a sorta solution:
- Define 3 layers: Image, Silhouettes, & Mask.
- Assign the puzzle image to the Image layer. I also suggest locking its position. With all the dragging of the pencil tool, it's easy to move it a little, throwing everything off.
- Define a rectangle shape the same size as the image. Set its fill to white. Assign it to the Mask layer. Hide it
- Trace the silhouettes. The pencil tool seems to work best. Set them all to no fill. Give them a fine line (border) or none. Assign them to the Silhouette layer.
- Hide the image and unhide the Mask.
- Select the mask and the silhouettes. Run the fragment tool. Select all of the pieces. Assign them to the Mask layer.
- Activate the Image layer. Push it to the background
Here's an example with one of our puzzles. This puzzle has a lot more sihouettes. I just did 4 because the process is kind painful.
(https://i.postimg.cc/gkVMxgg3/image.png)
All in all, it's not bad. And it's a lot cheaper than Photoshop. 👍😀
Comments?