Button - Crop Image Fixed Ratio

Several times a day I create passport like pictures from free images I find on the net (actors, Wikipedia). These pictures need to be in an exact ratio (3:4, standard portrait ratio), but of course they rarely are.

William Hogarth - David Garrick - Richard III - Google Art Project-491x372

David Garrick in Richard III on stage
Copyright Notice: By William Hogarth - 8AHFGbq7ICVHbA at Google Cultural Institute maximum zoom level, Public Domain, File:William Hogarth - David Garrick as Richard III - Google Art Project.jpg - Wikimedia Commons

This is a typical situation:

  • I have a high quality picture
  • I am only interested in the face (portrait!)

Cropping the Picture

So I use Opus's "Standalone Viewer" (DOUBLE-CLICK on the picture) and manually select the face (SHIFT-DRAG) which obviously results in a rather approximate result in the ratio.

What I need is an exact ratio of height = 4 units and width = 3 units (portrait ratio).

Cropping to an exact and fixed ratio

The solution for this issue I found in Leo's video

where around minute 3 in Leo demonstrates the creation of the button, code included. So to be clear: none of this is my idea, work or creation. All the credits go to Leo.

Selecting the area you want to crop

After installing Leo's button, I can toggle between

  • free selection for cropping
  • fixed selection (3:4) for cropping

Thus cropping the picture will always give me the desired portrait ratio, and leave me with what I want - a nicely cropped image

  • with a fixed, precise ratio
  • without the necessity to adjust the ratio everytime anew

Cropping the selected area

Once you've selected the area, there's one more step:

  1. RIGHT-CLICK in the picture
  2. Chose CROP from the Pop Up menu

chose crop

3. Don't forget to save the cropped picture, OK?

Button Code

@toggle:if Show VIEWERCMD=selaspect,3:4
@if:Show VIEWERCMD=selaspect,3:4
Show VIEWERCMD=selaspect,reset
@if:else
Show VIEWERCMD=selaspect,3:4

Of course, you can adjust the ratio to your preference for cropping images, possibly to the original 16:9.

Button

4;3.dcf (490 Bytes)

Install

Open a picture with the 'Standalone Viewer', set its toolbar to 'Customize' and drag the button into the toolbar. NOTE: The button only works within the 'Standalone Viewer (I am told)

Conclusion

This is a very simple and basic button I understand but for me as a non-coder with only limited experience with basic simple functions (and some regex) it is a real time saver. Instead of approximate ratios or spending a lot of time in GIMP I get a perfect, fixed ratio for my personal needs.

Note

My only accomplishment is that I put this together and created the screenshots. All the credits go to Leo.

See also: Crop image with fixed ratio

5 Likes