0

I need to convert many files of the same size to polar projections. This is easy to do in GIMP with the Polar Coordinates plugin (Filters > Distorts > Polar Coordinates). However, I'm not sure how to either automate or batch this process.

I know that it is possible to script the automation and there is a commonly suggested batch processing plug-in called BIMP. However, both options call the "plug-in-polar-coords" procedure which does not act the same way in script as it does in the GIMP GUI. Below is an example:

I need to go from files that look like this (courtesy of Flickr user gadl (Alexandre Duret-Lutz) under CC BY-NC-SA):

Stretched image of Phare du Paon, île de Bréhat by Alexandre Duret-Lutz

...to images that look like this:

Polar projected image of Phare du Paon, île de Bréhat by Alexandre Duret-Lutz

Which I've done with these settings in GIMP GUI:

Screenshot of GIMP polar coordinate window

Now I need to figure out how to do this with multiple images. I tried to use BIMP with the manipulation "plug-in-polar-coords" but it does not provide an option to map the image to a circle as in the Polar Coordinates window (i.e. the "To polar" radio button).

Screen shot of BIMP manipulation window

And outputs files that look like this:

Distorted polar projected image of Phare du Paon, île de Bréhat by Alexandre Duret-Lutz

Any thoughts on how to do this? I would prefer solutions in GIMP but will also accept solutions in Inkscape.

2
+50

The plug-ins are mostly implementing the Gimp 2.8 GUI. You would just need to set circle depth to 100% and "Polar to rectangular" to "False"

Demonstration: in the Gimp 2.8 UI I get the same output as you with these parameters:

enter image description here

And to get the picture you want I change to these:

enter image description here

To be more complete, using in 2.10 the same API as BIMP:

enter image description here

| improve this answer | |
  • Have you actually tried this? For me, it does not produce a circularized image. – et is Sep 24 at 12:47
  • I don't use BIMP but it works if I use the same parameters on my Gimp 2.8 copy, and your screenshot doesn't show that you are using these values. See enhanced answer – xenoid Sep 24 at 15:20
4

So I know next to nothing about Gimp, but you could do this in Imagemagick, which as long as you're able to install, should be as easy as copy&pasting the code into the command line and pressing enter.

cd "path to your input folder"
mkdir "../output" 

mogrify \
  -path "../output" \
  -rotate '180' \
  +distort Polar 0 \
  -virtual-pixel 'horizontal-tile' \
  -background 'black' \
  -quality 100 \
  -format jpg *

enter image description here

Explanations

  • cd "" - Input path goes here. You should be able to drag a folder into the command line window to get its path.
  • mkdir "" - Makes a folder. In this case the output folder.
  • mogrify
    • path "" - Path to output folder. ../ traverses one level up from the input folder.
    • rotate - This is used so the polar distort makes a globe. I don't know if distort would have an option for flipping the image but this works.
    • distort Polar - Polar distort
    • virtual-pixel - This option defines what color source should be used if and when a color lookup completely 'misses' the source image.
    • background
    • quality
    • format - Output format.
    • \ is used to split the mogrify command into multiple lines so it's easier to read.
| improve this answer | |
  • I use imagemagick in my website for basic image upload resizing, I had no idea it could do anything that fancy! I will have to look at that plugin more and see what else it can do. – Alith7 Sep 24 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.