It is currently Mon Aug 24, 2026 8:32 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Wed Nov 16, 2016 12:44 pm  (#1) 
Offline
New Member

Joined: Nov 16, 2016
Posts: 2
Hi,
I am new to gimp and coding. I noticed I am repeating my steps for all my images and was wondering if there is a way to automate the steps below. I have over 1000+ images to process.

Here are the steps that I am applying to each image.

-Load Tiff file. Image size is 4032 x 3024
-Scale image Width to 5362 and leave the height at 3024. Set Interpolation to "Sinc Lanczos3"
-Apply Filter UnSharp Mask with settings (5.0, 0.25,50)
-Apply final Scale to 1920x1083 with Interpolation to Sinc Lanczos3
-Export as a new PNG file with compression level 0 to new source directory.
-Discard Changes for original image

I do not know coding but anyone able to help with scripting? Thank you.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Wed Nov 16, 2016 2:43 pm  (#2) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4528
Location: Canada
try this script (you might have to change the settings to the apng_save settings in code).
But this is basically a script that will do those steps.

Qiko Automate Script for GIMP (for Qiko)

_________________
TinT


Last edited by trandoductin on Wed Nov 28, 2018 12:09 pm, edited 1 time in total.

Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Wed Nov 16, 2016 3:13 pm  (#3) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2613
Quote:
...I have over 1000+ images to process...


If you want to try all at once it should be possible using the batch plugin BIMP

http://www.alessandrofrancesconi.it/projects/bimp/

The second resize does pose a problem in that BIMP does not normally permit duplicate operations, however a regular gimp procedure can be used.

The sequence of operations looks like this;

Attachment:
bimp.jpg
bimp.jpg [ 184.57 KiB | Viewed 6112 times ]


On the slow side and I only tried it with a couple of images, it might choke on a 1000 images. Zero compression on the png's makes for big (8MB) files.


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Wed Nov 16, 2016 3:54 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Qiko wrote:
Hi,
I am new to gimp and coding. I noticed I am repeating my steps for all my images and was wondering if there is a way to automate the steps below. I have over 1000+ images to process.

Here are the steps that I am applying to each image.

-Load Tiff file. Image size is 4032 x 3024
-Scale image Width to 5362 and leave the height at 3024. Set Interpolation to "Sinc Lanczos3"
-Apply Filter UnSharp Mask with settings (5.0, 0.25,50)
-Apply final Scale to 1920x1083 with Interpolation to Sinc Lanczos3
-Export as a new PNG file with compression level 0 to new source directory.
-Discard Changes for original image

I do not know coding but anyone able to help with scripting? Thank you.


Scaling up to downscale doesn't make sense (just adds more blurriness) and the sharpening should be the last thing to do (it will recover some of the sharpness lost in the downscaling). All this can be done in the command line in one call to ImageMagick's 'convert' or 'mogrify' commands (even, if you insist, the upscale followed by a downscale).

_________________
Image


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Wed Nov 16, 2016 4:30 pm  (#5) 
Offline
New Member

Joined: Nov 16, 2016
Posts: 2
Thx, I will try all the above.

Update:
Tried the py script but it reported error:

GIMP Message: Calling error for procedure 'gimp-procedural-db-proc-info': Procedure "file-apng-save' not found.

Traceback (most recent call last):
File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 736, in response
dialog.res = run_script(params)
File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 361, in run_script
return apply(function, params)
File "C:\Users\GDCLA\.gimp-2.8\plug-ins\qiko_automate.py", line 52, in python_qiko_automate
pdb.file_apng_save(nextimage,layer,savefilename,savefilename,0,0,0,0,0,0,0)
error: procedure not found

I also tried the "BIMP" tool and it seems to work but the file grew larger than manually modifying. From 5.96MB to 7.94MB which might work for me.

Didn't try the ImageMagick's app yet. Is this a standalone prgm?

thanks


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Wed Nov 16, 2016 6:26 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Qiko wrote:
Didn't try the ImageMagick's app yet. Is this a standalone prgm?


Yes.

_________________
Image


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Wed Nov 16, 2016 11:17 pm  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4528
Location: Canada
Qiko wrote:
Thx, I will try all the above.

Update:
Tried the py script but it reported error:

GIMP Message: Calling error for procedure 'gimp-procedural-db-proc-info': Procedure "file-apng-save' not found.

Traceback (most recent call last):
File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 736, in response
dialog.res = run_script(params)
File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 361, in run_script
return apply(function, params)
File "C:\Users\GDCLA\.gimp-2.8\plug-ins\qiko_automate.py", line 52, in python_qiko_automate
pdb.file_apng_save(nextimage,layer,savefilename,savefilename,0,0,0,0,0,0,0)
error: procedure not found

I also tried the "BIMP" tool and it seems to work but the file grew larger than manually modifying. From 5.96MB to 7.94MB which might work for me.

Didn't try the ImageMagick's app yet. Is this a standalone prgm?

thanks

Looks like you have other alternatives...
but when you browse procedure from GIMP->Help-> do you see "apng" or "png" procedures?
Maybe you have some other method on your GIMP. I don't know why you don't have file-apng-save. It's on mine.

_________________
TinT


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Thu Nov 17, 2016 3:04 am  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
trandoductin wrote:
Looks like you have other alternatives...
but when you browse procedure from GIMP->Help-> do you see "apng" or "png" procedures?
Maybe you have some other method on your GIMP. I don't know why you don't have file-apng-save. It's on mine.


The OP never requested APNG? I read the request as needing 1000 distinct PNGs...

And file-apng isn't in standard Gimp... (not in my 2.8.18, in any case).

_________________
Image


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Thu Nov 17, 2016 5:43 am  (#9) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2613
Qiko wrote:
...snip...
I also tried the "BIMP" tool and it seems to work but the file grew larger than manually modifying. From 5.96MB to 7.94MB which might work for me.


BIMP adds an alpha channel to the png. Hence the larger file size. Can't find a way out of that one.

apng is for animated png's . Has not worked for me in linux since Gimp 2.6.x and needs a modified libpng. I am guessing maybe Partha's windows version of Gimp has it included.

Best place for advice and examples of ImageMagick batch files is
http://www.imagemagick.org/discourse-server/ - the user section


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Thu Nov 17, 2016 12:12 pm  (#10) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4528
Location: Canada
ofnuts wrote:
trandoductin wrote:
Looks like you have other alternatives...
but when you browse procedure from GIMP->Help-> do you see "apng" or "png" procedures?
Maybe you have some other method on your GIMP. I don't know why you don't have file-apng-save. It's on mine.


The OP never requested APNG? I read the request as needing 1000 distinct PNGs...

And file-apng isn't in standard Gimp... (not in my 2.8.18, in any case).


What is standard?
I searched for png but didn't see anything pop up.

_________________
TinT


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Thu Nov 17, 2016 5:02 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
file-png is a standard plugin.

_________________
Image


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Thu Nov 17, 2016 5:43 pm  (#12) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4528
Location: Canada
I don't have that anymore
I wonder if overwrote something when i installed something that was in an effort to have me exported animated pngs.... it never worked but i guess my system is non-standardized now

_________________
TinT


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Thu Nov 17, 2016 7:20 pm  (#13) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Trandoductin some things are right here on GimpChat Resize and Save

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Batch Scripting Resize - Sharpern - Resize help?
PostPosted: Fri Nov 18, 2016 6:19 am  (#14) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16167
If you installed the file-apng.exe file normally you would remove the file-png executable as you no longer need it. That is probably why you no longer have it. Are you looking in the program directory plug-ins folder Tran?

_________________
Image


Top
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group