Re: [Gimp-developer] batch processing



Imagemagick has a batch mode called "mogrify" so you can just use something
like this from the command line:

mogrify -format jpg -resize 3000 -define jpeg:extent=1000kb *.jpg

That will resize all jpegs in the directory to 3000px (height or width,
whichever is larger) and it will try to get close to 1000kb for the file
size.

For your use case you could also do:

mogrify -format jpg -resize 750 -quality 80 *.jpg

Hope it helps!

Note also that nautilus has the ability to be scripted with these commands
to execute on what you have selected.

I believe there is also already a script written for this to:


Install rotate and resize right-click functions:

sudo apt-get install nautilus-image-converter

restart of nautilus required


-C

On Sun, 11 Oct 2020, 06:41 Shlomi Fish, <shlomif shlomifish org> wrote:

Hi jcupitt !

On Sat, 10 Oct 2020 17:05:18 +0100
jcupitt--- via gimp-developer-list <gimp-developer-list gnome org> wrote:

If you're comfortable at the command-line, imagemagick is very simple
and runs everywhere:

https://imagemagick.org

With bash you can enter:

for i in *.jpg; do
    convert $i --resize x768 resized_version_$i
done

It is a good idea to wrap the $i in double quotes in bash and similar
shells to
prevent word splitting:

* https://shlomif-tech.livejournal.com/14671.html

* https://perl-begin.org/topics/security/code-markup-injection/


My image processing package nip2 can batch-process in a GUI way,
though it's a bizarre program.

https://github.com/libvips/nip2


Heh, it is nice that you admit that you think it is "bizarre". It shows
maturity to admit that one's software application is not perfect.

1. Start nip2
2. Click "File / Open", navigate to the source directory, click on the
first image, shift-click on the last, click Open
3. This will make a group of images, probably called A1. "Click
Toolkits / Image / Transform / Resize / Size to" to resize the group
4. Select Vertical, 768, Lanczos3 in the scrap of GUI you see
5. RIght-click on the name of the resize object (probably A2) and
select "Save as"
6. In the dialog, navigate to a destination directory, enter eg.
"fred00.jpg" as the filename, and click Save
7. The set of images will be saved as fred00.jpg, fred01.jpg, fred02.jpg
etc.

John


On Fri, 9 Oct 2020 at 11:26, Drake Koefoed via gimp-developer-list
<gimp-developer-list gnome org> wrote:

I would like to batch process a directory of images to h=768 retain
aspect
ratio.

I have not seen a simple way to do this.  Something like the wonderful
batch rename in Nautilus would be great if it exists or could be
written.
drakekoefoed mailfence com
_______________________________________________
gimp-developer-list mailing list
List address:    gimp-developer-list gnome org
List membership:
https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
_______________________________________________
gimp-developer-list mailing list
List address:    gimp-developer-list gnome org
List membership:
https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list



--

Shlomi Fish       https://www.shlomifish.org/
https://youtu.be/n6KAGqjdmsk - “Hurt Me Tomorrow”

I also have versions of this code in COBOL.NET, Intercal, PDP‐10
Assembly, J,
APL, Windows NT 4.0 Batch script and Autocad Lisp — I’m sure you can handle
all of them because none of them is Perl. ;-).

Please reply to list if it's a mailing list post - https://shlom.in/reply
.
_______________________________________________
gimp-developer-list mailing list
List address:    gimp-developer-list gnome org
List membership:
https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]