It is currently Mon Apr 15, 2024 7:55 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Help to use liquid resize in batch (or with a script )
PostPosted: Wed Feb 15, 2012 3:08 pm  (#1) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
I never did but i know is possible just i have no idea how

what i need is scale a series of images each to all most commune wallpaper sizes
and save them in a new folder adding to the images names the size

a example to clear suppose that the first input, i the first image of the series is "Lysergica Caves" and is was in pictures/Lysergica.

from that i need

Lysergica Caves"-1920x1200.png
"Lysergica Caves-1600x1200.png
"Lysergica Caves-1680x1050.png
Lysergica Caves--1440x900.png
Lysergica Caves-1280x800.png
Lysergica Caves-1400x1050.png
Lysergica Caves-1280x960.png
Lysergica Caves-1024x768.png
Lysergica Caves-1280x960.png
.Lysergica Caves -here-custom-size

all saved in a new "Wallpaper" subfolder inside the original directory (if was C:/...Pictures/Lysergica will be saved in C:/...Pictures/Lysergica/wallpaper

obviously each image should be scaled with liquid resize to the size indicated in the name

do manually would be impossible :gaah :cry but should be a way to do a similar batch
and i really need it :bawl

Also a scheme o python " Wallpaper Multiplier " script may be a cool solution
(obviously the script will depend from liquid rescale )

PS about saving have to indicate manually where would be not the problem, the problem i need to solve is how automatically apply Liquid Rescale as indicated

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


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: Help to use liquid resize in batch (or with a script )
PostPosted: Thu Feb 16, 2012 10:39 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Could Gimp Scripter do this?

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Thu Feb 16, 2012 12:44 pm  (#3) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
i have no idea

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Fri Feb 17, 2012 4:11 am  (#4) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Photocomix, can you give us a link to the plug-in you want to run please because if it's possible for me to install it easily, then I'll have a go at writing a script.

Kevin


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Fri Feb 17, 2012 4:28 am  (#5) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
sure
http://liquidrescale.wikidot.com/en:start

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Fri Feb 17, 2012 4:42 am  (#6) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Thanks.

As it has a very large number of parameters to set (26), I'm going to assume that the default settings are suitable (?)

Kevin


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Fri Feb 17, 2012 6:19 am  (#7) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Almost: obviously "output" should be "new image"

for the rest
1 Masks- no masks (default)

2 Output -New images
Resize canvas -true
Also in "Output" options
would be nice preserve the option to scale back..nice but far to be strictly needed
(most of times i would not scale back )

PS instead another option would made the script even more powerful and flexible :
use Liquid Rescale AND/OR normal gimp scale with this options:
Max quality- do NOT respect image ratio

If that possible then the names should be slightly modified to avoid overwriting :
as from "image.png"

image_1600x1200_LR( same for other sizes ) if scaled with Liquid Rescale
image_1600x1200_Sif scaled normally (again normally BUT without respecting image ratio

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Fri Feb 17, 2012 8:02 am  (#8) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2418
You could try Imagemagick liquid rescale.

The liquid rescale function is not something that I am very familiar with apart from knowing it exists.

You would need one command per final image size along the lines of:

convert *.jpg -liquid-rescale 1600x1200! -set filename:orig %t %[filename:orig]-1600x1200.jpg

but it will convert a folder full of images. Not very fast.

screen shot of a conversion, http://i.imgur.com/Xss4w.jpg

I can see where parts of the image in the middle have been squashed. It has really squashed the top of the image. It would be a 'try and see' experiment to find out if acceptable.

_________________
Image


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Fri Feb 17, 2012 1:53 pm  (#9) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Yes i know about the squashing but i like some possible effect, once you get why and when squashing occour then is possible dose it in a creative way...as below that is just on the edge of squashing (the 3wheel thingy was twice big )

Image

And i plan to use mostly to create fractal wallpaper where distortion are lees relevant because the mind has not a reference

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Fri Feb 17, 2012 2:30 pm  (#10) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2418
ouch! for you windows users.

Just got round to looking at IM liquid-rescale again and it looks like it is not yet implemented in windows, only linux. Just tried it in a WinXP and it comes up with an error.

sorry

_________________
Image


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Sat Feb 18, 2012 8:47 am  (#11) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Yes doesn't work

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Sun Feb 19, 2012 9:54 am  (#12) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
:bump

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Sun Feb 19, 2012 11:18 am  (#13) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2418
You don't seem to be having much luck with any Gimp-only suggestions.

Don't take offense, just throwing some suggestions into the hat.

Since you don't use linux and hence IM is not an option maybe something in java.

I am a fan of ImageJ and that has a seam-carving plugin.

Looking around, there is some code here http://code.google.com/p/java-imageseams/

Another java thought is this

http://www.its.caltech.edu/~justinj/cs176/HW1/index.htm
there is a link to the java executable and bottom of the page
"To invoke the program without a GUI, use java -jar SeamCarving.jar infile outfile forwardEnergy newWidth"

I can envisage a win batch file along the lines of
1. get a image
2. invoke the seamcarving.jar to reduce the width.
3. rotate the image so the depth is now the width (using IM )
4. invoke the seamcarving.jar to reduce the width.
5. back to the top and the next image

Almost certainly very slow, and maybe problem passing the filename as requested.

best of luck

_________________
Image


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Sun Feb 19, 2012 1:50 pm  (#14) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
ok i may even use linux, as a fact i have last kubuntu even if is long time i don't open it ,mostly because the wireless connection doesn't work and i can't use a wired connection
( If not seldom i am doing just now to update the OS but to do it i had to invade my old father room and privacy)

well i was hoping also for pajnicky but maybe he is too busy or i added too much requests in my last message..

And ok imagemagick may even solve for me even if to use it i must use the terminal but still i think that a gimp "Adapt to wallpaper" script would be very handy also for others

but is true you had given me all the pointers to solve i have only to switch to my linux partition and convince again my unconscious mind that the command line will not bit me, neither a typo (i always make typo ) will erase all the content of my HD

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Mon Feb 20, 2012 4:02 am  (#15) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Just too say that I won't be doing this script. Work and life are too busy at the moment.

Kevin


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Mon Feb 20, 2012 4:53 am  (#16) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
OK i'm trying to fix my Kubuntu (something wrong with the update, i can't get the permission to update even as sudo ) and then i will go with imagemagick

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Mon Feb 20, 2012 6:19 am  (#17) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2418
Looking at your Lysergica Caves images on Flickr, seems that the images will be mostly scaled up rather than down. That is going to rule out that little java application.

IM in linux still works, this is one of your largest published 1110x832 scaled to 1920x1200

Image

maybe ok?

_________________
Image


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Mon Feb 20, 2012 7:40 am  (#18) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
yes it is ok
I believe i must wipe out my kubuntu since i don't find anyway to get the permission (no even as sudo) to install a couple of files needed to update and the software and update manager went mad (they do not display anymore the pop up to give the permission to update, no way...and then they refuse to apply any change because lack of permission , i tried to use apt-get as sudo but even that refuse to install that damned couple of files )

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Mon Feb 20, 2012 11:53 am  (#19) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2418
Still not Gimp, but using IM and java.
This is just an experiment/proof-that-it might-work in Windows (a winxp machine I keep for video editing - had to install java). To keep things simple I had the jar file and the image(s) in the same folder. Just a batch file that takes one parameter the filename

rem just use the imagename no extension
rem assuming the infile is smaller than the final image otherwise alter the resize setting.
    convert %1.png -resize 1920 -rotate 90 temp1.png
rem default java runs out of memory so increase the heap value
    java -Xmx512M -jar SeamCarving.jar temp1.png temp2.png forwardenergy 1200
rem rotate back to correct orientation and rename
    convert temp2.png -rotate -90 %1-1920x1200.png
rem tidy up
    del temp*.png
rem
rem you would need another block for the next size.


If your original size is the same proportion as your Flickr image 1110x832 then some of the scaled sizes don't really need anything other than a regular rescale.

Tried the worst case with the above size 1920x1200, which needs to 'lose' 239 pix off the depth and the result was as good as the IM seamcarving function.

_________________
Image


Top
 Post subject: Re: Help to use liquid resize in batch (or with a script )
PostPosted: Mon Feb 20, 2012 12:35 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2238
Location: Poland
This is only a suggestion how to call the LQR (using python) in Windows

#!/usr/bin/env python

def plugin_main(image, drawable):

  gimp.pdb.plug_in_lqr( image, drawable, 1920, 1200, 0, 0, 0, 0, 0.0, 0, 0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "foo", "foo", "foo", "foo", run_mode=RUN_NONINTERACTIVE)
  gimp.pdb.gimp_image_resize_to_layers( image)

if __name__ == "__main__":
  from gimpfu import *   
 
  register(
    "python-fu-switch-to-plug-in-lqr",
    "A switch to <Image>/Layer//Liquid rescale...",
    "This a created in LQR new resized image...",
    "MQ",
    "GimpChat",
    "2012-02-20",
    "<Image>/Image/Resize 1920x1200",
    "RGB*, GRAY*",
    [],
    [],
    plugin_main,
    ) 
  main()


Attachments:
plugin-shortcut-to-plug-in-lqr.zip [523 Bytes]
Downloaded 69 times
python-fu-switch-to-plug-in-lqr.png
python-fu-switch-to-plug-in-lqr.png [ 151.2 KiB | Viewed 1108 times ]

_________________
Image

Slava
Ukraini!
Top
Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) converting 32 bit images to 8 bit using batch script

5

No new posts Attachment(s) Seeking Help with First Multi-File Batch Script

9

No new posts Attachment(s) Batch export all opened images script for GIMP [Update]

13

No new posts Attachment(s) Liquid rescale fot Gimp 2.10.18

2

No new posts Attachment(s) Can't resize brush

23



* Login  



Powered by phpBB3 © phpBB Group