Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Crop an image to contain only pixels included in a predefined region
ResourceFunction["ImageRegionCrop"][img,reg] crops image img to include only those pixels that are members of the region reg. |
Crop an image to a circular shape:
| In[1]:= |
| Out[2]= | ![]() |
Create a pentagonal image:
| In[3]:= |
| Out[3]= | ![]() |
Any 2D region can be used:
| In[4]:= |
| Out[4]= | ![]() |
| In[5]:= |
| Out[5]= | ![]() |
Regions may need to be rescaled to fit within the image:
| In[6]:= |
| Out[6]= | ![]() |
Use a geographical region to delimit the cropping:
| In[7]:= |
| Out[7]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License