Photo editing

Hello.I have a folder with photos of the stone.I need to edit them with grasshopper.

  1. insert from folder photos of stone into grasshopper.
  2. create a rectangle the size of the stone in the picture.
  3. trim image
  4. scale to actual size
    How to do it with grasshopper in automatic mode ?
    Stone.3dm (1.8 MB)

You will need to install the Javid components who have image manipulation capabilities.

This definition it is not complete but can be a good starting point to create your desired workflow:

Image Crop.gh (16.4 KB)

3 Likes

Oh, thank you very much for your help.


Do you think it is possible to achieve automatic recognition of the size of the cropping rectangle?

No. Unless all photos are taken from the same distance from the object and scaling grid, so that you could assume a scaling value. Grasshopper would have to be able to read the bitmap display of the gridlines as geometry, and it can’t do that.

You’re unlikely to have automatic recognition, but you could still optimise it - if you had a text file with the rectangle dimensions, you could read those alongside the bitmaps or alternatively you could save the dimensions in the file path and read them from there?

For that you will need additional components that I don’t know if they do exist. There are also some components to manipulate images in the “Bitmap” components.

Maybe will be easier to get in contact to the authors of Javid and Bitmap components and ask them if theirs components can do this or maybe they can develop some component to do the feature recognition.

P.S: Found something that can help-you. You need to install the Wizard components:

Image Crop.gh (20.2 KB)

If you can extract a shape representing the Marble piece, after that you can apply a BoundingBox to that shape, deconstruct the BoundingBox and get the lower-left corner and the size of the part you want to crop, and from there will be easier to create the rest of your workflow.

1 Like


Yes, this option is better. But you still need to specify the point.

Thank you, I’ll try to solve it