Re: [Gimp-user] Image transformation batch processing

2015-05-31 Thread JLuc

Thanks for this inspiring piece of code.

JLuc

Le 29/05/2015 18:32, Saul Goode a écrit :


On 28/05/15 19:44, JLuc wrote:


What is that for a lisp-like code ?


The difficulty that arises when recursing into subdirectories is that Script-fu 
does not provide a means of creating subdirectories (yet[1]). If I were to 
place all of the processed files in the same output directory, identically 
named files in subdirectories would overwrite each other, and I am too lazy to 
devise some renaming scheme that takes such duplicates into account.


[1] https://bugzilla.gnome.org/show_bug.cgi?id=725626
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list




___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Image transformation batch processing

2015-05-29 Thread Saul Goode

On 28/05/15 19:44, JLuc wrote: 

>What is that for a lisp-like code ?

The difficulty that arises when recursing into subdirectories is that Script-fu 
does not provide a means of creating subdirectories (yet[1]). If I were to 
place all of the processed files in the same output directory, identically 
named files in subdirectories would overwrite each other, and I am too lazy to 
devise some renaming scheme that takes such duplicates into account.


[1] https://bugzilla.gnome.org/show_bug.cgi?id=725626
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Image transformation batch processing

2015-05-28 Thread Ofnuts

On 28/05/15 19:44, JLuc wrote:

Le 26/05/2015 23:43, Saul Goode a écrit :
The following code will work on GNU/Linux systems. It will only 
process the filesin the current directory (it will not recurse into 
subdirectories).


What is that for a lisp-like code ?

JL


This is just a  big Scheme script (Gimp's historical scripting language) 
as a here-document in a bash script.



___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list

Re: [Gimp-user] Image transformation batch processing

2015-05-28 Thread JLuc

Le 26/05/2015 23:43, Saul Goode a écrit :

The following code will work on GNU/Linux systems. It will only process the 
filesin the current directory (it will not recurse into subdirectories).


What is that for a lisp-like code ?

JL



gimp -i -f -b - < factor 1)
 (gimp-image-scale image (/ w factor) (/ h factor))
 (set! w (car (gimp-image-width image)))
 (set! h (car (gimp-image-height image
   (if (< w h)
 (gimp-image-resize image (max w h) (max w h) (/ (- h w) 2) 
0)
 (gimp-image-resize image (max w h) (max w h) 0 (/ (- w h) 
2
 (gimp-file-save 1 image (car (gimp-image-flatten image)) 
filename filename)
 (gimp-image-delete image))
   (loop (cdr filepaths)))
 (gimp-quit 0))
HERE

___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list




___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list

Re: [Gimp-user] Image transformation batch processing

2015-05-26 Thread Saul Goode
The following code will work on GNU/Linux systems. It will only process the 
filesin the current directory (it will not recurse into subdirectories).

gimp -i -f -b - < factor 1)
    (gimp-image-scale image (/ w factor) (/ h factor))
    (set! w (car (gimp-image-width image)))
    (set! h (car (gimp-image-height image
  (if (< w h)
    (gimp-image-resize image (max w h) (max w h) (/ (- h w) 2) 
0)
    (gimp-image-resize image (max w h) (max w h) 0 (/ (- w h) 
2
    (gimp-file-save 1 image (car (gimp-image-flatten image)) 
filename filename)
    (gimp-image-delete image))
  (loop (cdr filepaths)))
    (gimp-quit 0))
HERE

___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list

Re: [Gimp-user] Image transformation batch processing

2015-05-11 Thread Liam R. E. Quin
On Mon, 2015-05-11 at 19:30 -0400, Kristen Sullivan wrote:
> ok so I can't find the link to my thread I made so I'm lost LOL\

Bestto change the subject line at least infuture.

> 
> OK so I have uninstalled this program and installed it AGAIN.

Where exactly are you downloading GIMP from?
Which exact version?
Please paste the exact and full URL.

Is this on a GNU/Linux™ system? Or Microsoft Windows? or the Mac? or 
what? Which exact version?

Is it a 32-bit or a 64-bit computer?

How are you running GIMP exactly?

It is difficult even to begin to answer your questions without such 
detail. GIMP does work for a great many people, unless you use one of 
the fake or bad download sites, or download the wrong version for your 
operating system, for example.



>  I go and open
> a 800X600 image and still force closes. IDK what is going on with 
> this but
> I dont know what to do either. 

Does GIMP open by itself with no image?

If you send me a copy of the image (or the URL where I can download 
it, if that's an option) I can look at it.

If you are on a Linux or Unix system (including OS X) the terminal 
command
$ file the-image.jpg
(or whatever the file is called) may tell you the image format; if it 
doesn't match the filename's extension, you may need to rename it, or 
tell GIMP the file format in the Open dialogue box.

Liam



> I don't know if it is easier to get help from a GIMP creator but do 
> they come out here? If so please email me at kristen6...@gmail.com   
> I have tried to open the gimp program again and till crashing. I 
> would LOVE to talk to someone that is the creator or someone VERY 
> VERY knowledgeable about gimp. Anyways IDK if this message is
> going to get any of you or be posted on that thread I made but if 
> you could
> send me the link to my thread I'd appreciate that.
> 
> Thanks :)
> 
> On Mon, May 11, 2015 at 5:17 PM, lloyd_borrett  > wrote:
> 
> > Thanks Jay.
> > 
> > --
> > lloyd_borrett (via www.gimpusers.com/forums)
> > ___
> > gimp-user-list mailing list
> > List address:gimp-user-list@gnome.org
> > List membership: 
> >  https://mail.gnome.org/mailman/listinfo/gimp-user-listList 
> > archives:   https://mail.gnome.org/archives/gimp-user-list
> > 
> ___
> gimp-user-list mailing list
> List address:gimp-user-list@gnome.org
> List membership: 
>  https://mail.gnome.org/mailman/listinfo/gimp-user-listList archives: 
>   https://mail.gnome.org/archives/gimp-user-list
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list

Re: [Gimp-user] Image transformation batch processing

2015-05-11 Thread David Benfell

Quoting Pat David :


Imagemagick is the more likely candidate for batch processing in this way.
There are a couple of clarifications, though.


I concur. Specifically, the convert tool, although you may need  
additional tools to identify your input and tailor the convert command  
accordingly.



--
David Benfell 


pgpO1YESg81Tc.pgp
Description: PGP Digital Signature
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list

Re: [Gimp-user] Image transformation batch processing

2015-05-11 Thread Kristen Sullivan
ok so I can't find the link to my thread I made so I'm lost LOL

OK so I have uninstalled this program and installed it AGAIN. I go and open
a 800X600 image and still force closes. IDK what is going on with this but
I dont know what to do either. I don't know if it is easier to get help
from a GIMP creator but do they come out here? If so please email me at
kristen6...@gmail.com   I have tried to open the gimp program again and
till crashing. I would LOVE to talk to someone that is the creator or
someone VERY VERY knowledgeable about gimp. Anyways IDK if this message is
going to get any of you or be posted on that thread I made but if you could
send me the link to my thread I'd appreciate that.

Thanks :)

On Mon, May 11, 2015 at 5:17 PM, lloyd_borrett  wrote:

> Thanks Jay.
>
> --
> lloyd_borrett (via www.gimpusers.com/forums)
> ___
> gimp-user-list mailing list
> List address:gimp-user-list@gnome.org
> List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
> List archives:   https://mail.gnome.org/archives/gimp-user-list
>
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] Image transformation batch processing

2015-05-11 Thread lloyd_borrett
Thanks Jay.

-- 
lloyd_borrett (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Image transformation batch processing

2015-05-11 Thread Jay Smith

On 05/10/2015 11:45 PM, lloyd_borrett wrote:

G'day,

I have many directories of images, totaling more than 5000 images in total.
Each image might be in a jpg, gif or png file format.
I want to change all images to have a 1:1 aspect ratio, on a white background.
I want no image to exceed 1000 x 1000 pixels at 72 dpi.
Images already within the 1000x1000 limit should be extended to have a 1:1
aspect ratio, as required.
At no point is any image scaled upwards in size.
All images should be saved in a suitably compressed way for displaying on web
sites.
The new images should be written into a sub-directory, with the original images
being left in place and unchanged.
Would like to do this as a single batch process, if needs be per directory.

Here are some examples as to what should happen:

1200x1200: Image re-sized to 1000x1000. Save compressed.

1600x1200: Image re-sized to 1000x750. Then extended to 1000x1000, centred on a
white background. Save compressed.

1200x1600: Image re-sized to 750x1000. Then extended to 1000x1000, centred on a
white background. Save compressed.

750x750: Save compressed.

800x600: Image extended to 800x800, centred on a white background. Save
compressed.

600x800: Image extended to 800x800, centred on a white background. Save
compressed.

Is it possible to achieve the above using Gimp?

If so, how?

If not, can you please recommend a image processing tool that can do this?

Best regards, Lloyd Borrett.



Though we have not done some of the specific tasks or had some of the 
specific limitations/operations you describe, we have done operations 
fairly similar to this that require a lot of complex if-then-else logic. 
 To accomplish this, we used Perl and Imagemagick -- this was a few 
years ago, but I think there is/was a Perl image processing module to 
aid in such situations.


I don't recall all the details and I can't help with code samples. 
However, the good news is that the input was in the tens of thousands of 
images and the output was 4x the input (there were four output streams, 
not just one as you need, because our output had in four size ranges, 
not just your one range).  While the code took a bit of work to develop, 
the actual running (and re-running because there were always new or 
modified inputs that had to be detected/compared as new and thus new 
output created), was surprisingly fast.  Obviously the bigger the 
machine (I think we were running on a machine 16 cores and 16 GB of 
RAM), the faster the results.


One or two tiny suggestions.  You describe that the output needs to be 
centered on a white background (if the output is less than 1000 in a 
particular dimension).  The "white background" should be a command line 
parameter type of setting so that you don't have to dig into the code to 
change background color that for a particular run.  You may also want to 
consider the potential use of transparent background (if supported by 
file type of the image type being used for the output) and do the "color 
of background" on the display side (if possible) rather than in the 
image -- that would give you greater flexibility; then you might just 
need a one-line CSS change for your entire website rather than 
regenerating umpteen images.


Jay
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Image transformation batch processing

2015-05-11 Thread Pat David
This could possibly be done with BIMP, but it's likely not the best tool to
achieve this across so many images.

Imagemagick is the more likely candidate for batch processing in this way.
There are a couple of clarifications, though.

If an image is <1000px on any side, should the image canvas size be
increased to meet your 1000x1000 px requirement?

ie: 800x600: center the 800x600 image on a 1000x1000 white background?  Or
just square it on a white background to the largest size dimension that is
<1000px?

On Mon, May 11, 2015 at 3:01 PM lloyd_borrett  wrote:

> G'day,
>
> I have many directories of images, totaling more than 5000 images in total.
> Each image might be in a jpg, gif or png file format.
> I want to change all images to have a 1:1 aspect ratio, on a white
> background.
> I want no image to exceed 1000 x 1000 pixels at 72 dpi.
> Images already within the 1000x1000 limit should be extended to have a 1:1
> aspect ratio, as required.
> At no point is any image scaled upwards in size.
> All images should be saved in a suitably compressed way for displaying on
> web
> sites.
> The new images should be written into a sub-directory, with the original
> images
> being left in place and unchanged.
> Would like to do this as a single batch process, if needs be per directory.
>
> Here are some examples as to what should happen:
>
> 1200x1200: Image re-sized to 1000x1000. Save compressed.
>
> 1600x1200: Image re-sized to 1000x750. Then extended to 1000x1000, centred
> on a
> white background. Save compressed.
>
> 1200x1600: Image re-sized to 750x1000. Then extended to 1000x1000, centred
> on a
> white background. Save compressed.
>
> 750x750: Save compressed.
>
> 800x600: Image extended to 800x800, centred on a white background. Save
> compressed.
>
> 600x800: Image extended to 800x800, centred on a white background. Save
> compressed.
>
> Is it possible to achieve the above using Gimp?
>
> If so, how?
>
> If not, can you please recommend a image processing tool that can do this?
>
> Best regards, Lloyd Borrett.
>
> --
> lloyd_borrett (via www.gimpusers.com/forums)
> ___
> gimp-user-list mailing list
> List address:gimp-user-list@gnome.org
> List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
> List archives:   https://mail.gnome.org/archives/gimp-user-list
>
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] Image transformation batch processing

2015-05-11 Thread lloyd_borrett
G'day,

I have many directories of images, totaling more than 5000 images in total.
Each image might be in a jpg, gif or png file format.
I want to change all images to have a 1:1 aspect ratio, on a white background.
I want no image to exceed 1000 x 1000 pixels at 72 dpi.
Images already within the 1000x1000 limit should be extended to have a 1:1
aspect ratio, as required.
At no point is any image scaled upwards in size.
All images should be saved in a suitably compressed way for displaying on web
sites.
The new images should be written into a sub-directory, with the original images
being left in place and unchanged.
Would like to do this as a single batch process, if needs be per directory.

Here are some examples as to what should happen:

1200x1200: Image re-sized to 1000x1000. Save compressed.

1600x1200: Image re-sized to 1000x750. Then extended to 1000x1000, centred on a
white background. Save compressed.

1200x1600: Image re-sized to 750x1000. Then extended to 1000x1000, centred on a
white background. Save compressed.

750x750: Save compressed.

800x600: Image extended to 800x800, centred on a white background. Save
compressed.

600x800: Image extended to 800x800, centred on a white background. Save
compressed.

Is it possible to achieve the above using Gimp?

If so, how?

If not, can you please recommend a image processing tool that can do this?

Best regards, Lloyd Borrett.

-- 
lloyd_borrett (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list