I'm trying to use ImageMagick to emulate the rotate and crop function of Gimp to use it on a batch of images.
What I would do in Gimp is to open the .jpg image, use the rotation tool with the following options: 0.2°, cubic interpolation and crop with the original image ratio. After that with just another crop around the image borders the process is complete and I can save the image as .png
I'm not using Gimp because the built in procedure gimp-drawable-transform-rotate-default only accepts radians with two decimals. I tried to find a way to edit that procudere and to create my own but I wasn't able to do so
I wal also suggested to use ImageMagick because the batch is very large (50k+ images), therefore, can you help me with the console command to emulate what I would do with Gimp? In particular the important part is the crop with the original image ratio
Edit:
When you rotate an image, if the ° aren't 90-180-270 etc.., the size of the image is increased and therefore new pixels must be created. The following crop must:
- Delete all the pixels added during the rotation to fill the blank spaces
- The final ratio has to be as close ad possible to the initial one
- What comes to be cropped (ofc the crop has to be centered) that was present in the original image has to be the as little as possible
Basically you should't be able to see the differences between the original and the edited images just by looking at them
The procedure that I described for Gimp already did everything but it works only on one image at a time