RSS/Atom feed Twitter
Site is read-only, email is disabled

how to exposing more tiff load options for scripting

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

10 of 10 messages available
Toggle history

Please log in to manage your subscriptions.

how to exposing more tiff load options for scripting Tim Dickson 18 Aug 21:08
  how to exposing more tiff load options for scripting Burnie West 18 Aug 21:38
   how to exposing more tiff load options for scripting Daniel Smith 18 Aug 22:47
    how to exposing more tiff load options for scripting Chris Mohler 18 Aug 22:50
     how to exposing more tiff load options for scripting Daniel Smith 19 Aug 00:07
      how to exposing more tiff load options for scripting Chris Mohler 19 Aug 00:40
       how to exposing more tiff load options for scripting Tim Dickson 19 Aug 11:08
       how to exposing more tiff load options for scripting Tim Dickson 20 Aug 09:12
how to exposing more tiff load options for scripting Jernej Simončič 19 Aug 12:18
how to exposing more tiff load options for scripting Jernej Simončič 20 Aug 15:04
Tim Dickson
2012-08-18 21:08:59 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

I am trying to load single pages from multipage tiffs, convert them to monochrome (dithered), flatten the image, then save them as single monochrome, ccitt group4 tiffs. - all through scripts.

The multipage tiffs contain pages in grayscale and colour which were created using the old style (problematic) jpeg compression option.

I have tried other tools, such as libtiff (modified with a patch to handle the old jpeg compression), and the latest version of imagemajick. Unfortunately they cannot correctly convert the files, whereas gimp can, but only one page of the multi-page tiff at a time (gimp crashes if I load a 5page document (as separate images) then convert each image to monochrome,flatten and save in one session)

the scripting function for loading tiffs file-tiff-load
does not expose the options to load individual pages, or to select loading as images or as layers, which the visual file load/import does.

does anyone have any suggestions as to how I can achieve this using a script.?
manually is not a problem, but too time consuming for large (eg. 200page) tiffs.
thanks, tim

Burnie West
2012-08-18 21:38:47 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

On 08/18/2012 02:08 PM, Tim Dickson wrote:

I am trying to load single pages from multipage tiffs, convert them to monochrome (dithered), flatten the image, then save them as single monochrome, ccitt group4 tiffs. - all through scripts.

The multipage tiffs contain pages in grayscale and colour which were created using the old style (problematic) jpeg compression option.

I have tried other tools, such as libtiff (modified with a patch to handle the old jpeg compression), and the latest version of imagemajick. Unfortunately they cannot correctly convert the files, whereas gimp can, but only one page of the multi-page tiff at a time
(gimp crashes if I load a 5page document (as separate images) then convert each image to monochrome,flatten and save in one session)

Are you using a developmental version (2.9 --)? If not, the crash itself warrants a bug report.

the scripting function for loading tiffs file-tiff-load
does not expose the options to load individual pages, or to select loading as images or as layers, which the visual file load/import does.

does anyone have any suggestions as to how I can achieve this using a script.? manually is not a problem, but too time consuming for large (eg. 200page) tiffs. thanks, tim
_______________________________________________ gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list

Daniel Smith
2012-08-18 22:47:32 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

I don't exactly get what you mean by 200 page tiffs? You mean one continuous image that takes 200 pages worth of sub-images? But anyways, are you using the batch mode? I've never done it but I understand there
are a lot of options there from non-interactive command line mode? http://www.google.com/search?client=safari&rls=en&q=gimp+scripting+options+command+line&ie=UTF-8&oe=UTF-8 Dan

On 8/18/12, Burnie West wrote:

On 08/18/2012 02:08 PM, Tim Dickson wrote:

I am trying to load single pages from multipage tiffs, convert them to monochrome (dithered), flatten the image, then save them as single monochrome,
ccitt group4 tiffs. - all through scripts.

The multipage tiffs contain pages in grayscale and colour which were created
using the old style (problematic) jpeg compression option.

I have tried other tools, such as libtiff (modified with a patch to handle the
old jpeg compression), and the latest version of imagemajick. Unfortunately
they cannot correctly convert the files, whereas gimp can, but only one page
of the multi-page tiff at a time
(gimp crashes if I load a 5page document (as separate images) then convert

each image to monochrome,flatten and save in one session)

Are you using a developmental version (2.9 --)? If not, the crash itself warrants a bug report.

the scripting function for loading tiffs file-tiff-load
does not expose the options to load individual pages, or to select loading as
images or as layers, which the visual file load/import does.

does anyone have any suggestions as to how I can achieve this using a script.?
manually is not a problem, but too time consuming for large (eg. 200page) tiffs.
thanks, tim
_______________________________________________ gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list

_______________________________________________ gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list

Chris Mohler
2012-08-18 22:50:15 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

On Sat, Aug 18, 2012 at 5:47 PM, Daniel Smith wrote:

I don't exactly get what you mean by 200 page tiffs? You mean one continuous image that takes 200 pages worth of sub-images?

TIFF can store multiple images (pages) in one file. TIFF is one of the most abused image formats I know of ;) http://en.wikipedia.org/wiki/Tagged_Image_File_Format#Multiple_subfiles

Chris

Daniel Smith
2012-08-19 00:07:18 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

That must be one heck of a big file. I used to work in graphics but nothing like that.
This topic reminds me of the woman a while back who was making a giant fabric image like a mile long? lol.
Thanks.
Dan

On 8/18/12, Chris Mohler wrote:

On Sat, Aug 18, 2012 at 5:47 PM, Daniel Smith wrote:

I don't exactly get what you mean by 200 page tiffs? You mean one continuous image that takes 200 pages worth of sub-images?

TIFF can store multiple images (pages) in one file. TIFF is one of the most abused image formats I know of ;) http://en.wikipedia.org/wiki/Tagged_Image_File_Format#Multiple_subfiles

Chris

Chris Mohler
2012-08-19 00:40:06 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

On Sat, Aug 18, 2012 at 7:07 PM, Daniel Smith wrote:

That must be one heck of a big file. I used to work in graphics but nothing like that.
This topic reminds me of the woman a while back who was making a giant fabric image like a mile long?

It's probably not that bad, since they are grayscale and JPEG-compressed. By the OP's desire to save as CCITT 1-bit, I infer that they're probably document scans, so the JPEG/TIFF compression would keep the file size down.

Since there's nothing in the procedure browser that seems to deal with multipage TIFFs, I'm not sure GIMP can be scripted to deal with them though. Some time ago, I looked at extending what was exposed to the procedure browser but I couldn't really make heads or tails of it.

Hmm - how about getting ImageMagick to just split the TIFFs into individual files, then running the batch plug-in or your own script?

Chris

PS - I'm a freelancer and dabble in a bit of everything. Feel free to contact me off-list if you'd want to hire me to look into it for you.

Tim Dickson
2012-08-19 11:08:38 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

To answer the various questions. (for some reason i did not get the posts, but found them in the mailing list archive) 1. I am using gimp 2.8 (windows version in this case - the version that comes with slackware is somewhat older) 2. yes the files are scans of sometimes rather large documents eg 230 pages file size 1-2gb or so.
3. You may have noticed I said in my original post that I had already tried imagemajick but it would not work correctly. (version 6.7.9 Q16). I can extract the correct number of images, but the contents of some of them are blank/garbage.
3b. when running gimp manually and just loading a single page from the tiff, gimp can successfully load, allow me to edit and save the individual pages that are garbage when using imagemajick 5. yes I should report a bug due to gimp crashing, but unfortunately the (tiff) file is confidential, so it can't be released for testing by others. I don't mind testing release or debug versions (of gimp) on it and reporting though.

ps thanks for the offer. I am already getting someone with alternate custom image tools to look at it (my particular problem), but from a stand-point of improving gimp functionality, fixing bugs, and doing it myself I posted this request. It seems that gimp multi-image handling is behind the rest of its expansive features. If you load a multi-page/image tiff as layers, or as images, you can't save it as a single multi-image tiff.
Regards, Tim

Jernej Simončič
2012-08-19 12:18:47 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

On Sun, 19 Aug 2012 12:08:38 +0100, Tim Dickson wrote:

1. I am using gimp 2.8 (windows version in this case - the version that comes with slackware is somewhat older)

Note that the Windows version of GIMP ships with older version of libtiff, because there are problems with the most recent one on Windows.

Tim Dickson
2012-08-20 09:12:48 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

regarding libtiff.
which version does gimp for windows use?

I will download v4.0.2 for my distro and recompile (enabling the ojpeg options again) and see if the upated standard libtiff programs can handle the files properly ( I had to specially modify libjpeg 6b to support the old jpeg format in libtiff, then recompiled libtiff (3.8.2) with that ojpeg support.

I had been confused because my distribution, even a quite old version (12.2.0 slackware) has libtiff 3.8.2 but the most recent version on www.libtiff.org is 3.61 however, I have found that www.remotesensing.org have a much more up-to-date version.(v4.0.2) regards, Tim

Jernej Simončič
2012-08-20 15:04:44 UTC (over 11 years ago)

how to exposing more tiff load options for scripting

On Mon, 20 Aug 2012 10:12:48 +0100, Tim Dickson wrote:

which version does gimp for windows use?

3.9.6. There's a problem with 4 which made it unusable for GIMP on Windows (but this's been fixed in git, so the next GIMP version will probably use whatever's the latest 4.x version available in the OpenSuSE repo).