Dealing with BigTiff files (open, edit, save, etc)

Hello everyone,

I am currently working with some BigTiff bio-images that are all more than 8 gbs. All of them need some transformation editings like flip, trim and free transformation. Photoshop was able to read and edit, but fail to save them due to file size limitation (psd wont work because we need the tiff format, and I want to keep the original resolution due to the need to later analysis). If anyone know any image processing software that can save BigTiff file with no size limitation, please let me know, and any other advice are welcome as well!

Thank you
Jonathan

Have you tried using the gimp?

Thanks for the reply, I am trying right now. The thing is that gimp can edit, but often crash or very slow…(probably due to my computer setup, I only have 16gb of ram), I have not tried whether it can write bigtiff though.

If you’re going to load an 8gb tiff file and do a free transform, you’re probably going to need way more than 16 GB ram.

If you know what needs to be done to your images without making visual edits, you could try a command line program like imagemagick or gmic.

1 Like

It depends on what your intentions are for your images. If your files are scientific, it might be better for you to use math and science oriented packages instead of general purpose raster editors like PS, GIMP, ImageMagick and G’MIC. The latter two can do other things as well, but I am not sure how efficiently.

On this forum, we are most familiar with GIMP and G’MIC; if you have any questions regarding the two, we can help. But more information is necessary, such as sample files and workflow details.

Thanks for the reply, let me explain the work flow a bit. In my pathological study, we first did the staining of postmortem human tissue, and then mount them on slice, and scan them with high resolution camera. The problem is there is an error occurred during the mounting process, and the person flipped part of the tissue around, while the rest is correctly oriented. There is risk of remounting, so we figured we may be able to get out of it by image modification with software: cut the part that is incorrectly oriented and edit it, save as a new file. I dont think using existing image processing package would help because it require visual editing in a sense…

I tried Photoshop before, the memory management of photoshop seems better than gimp, but photoshop does not support writing BigTiff, may be gimp does? I will look into the other two you mention as well! Thank you!

Yeah I figure so too… I will try to find a 32 gb ram computer to try.
And yes, I think visual editing is a must in this case.

1 Like

I suggest you give G’MIC CLI a try. You could download it here: https://gmic.eu/download.shtml. While it is CLI, it does have the ability to preview the image buffer. Upload an example file and I or someone else can help you. It doesn’t have to be a part of your actual experiment if you want to keep that private. We just need a file that is similar to it to be able to help you in concrete terms.

Thanks for the suggestion! I will give that a shot, and hopefully gimp doesn´t have saving limitation on file size…I am more than happy to let you try on my image, I will ask my PI if I can send you an actual one. If not, I will look for a similar situation, but these files are huge, some are more than 10gb.

Command-line tools for large TIFF include tifftopnm and pamtotiff.

Then pamflip, pnmrotate, and so on can be used.

Or use tiffcrop to chop the tiff into smaller tiffs, or concatenate them.

pamscale can make a smaller version of the image, for semi-interactive work.

1 Like

The best thing I know for really big images is is vips/nip2:
https://libvips.github.io/libvips/

It was developed and is used for big images.

2 Likes

Good you mentioned this! Actually, PhotoFlow is based on vips, so it has the same advantages on large images, and therefore it might be a good alternative.

@JonathanLGUMI would it be possible for you to share a sample image?

Agreed. I only remembered about vips/nip2 as I was falling asleep.

Thanks for the reply!
I should ask my PI first (but I personally dont think providing sample image would be a problem)
I am now exploring option of finding a library that can open PSB file though.

I took a look at libvips, seems like I cannot do visual editing with that, which is required in my case…

Nip2, which is built on Vips, is a visual editor. And you can build your own chains of image processing, just like a spreadsheet has chains of arithmetic processing.

PhotoFlow (Release Continuous build · aferrero2707/PhotoFlow · GitHub) is a UI built around libvips, and targeting image/photo editing… it provides non-destructive “adjustment layers” in a way that should be relatively familiar to PS users.

i don’t know about bigtiff - an option is to export from gimp in png and then use ImageMagick (or GraphicsMagick) mogrify command to convert to tiff. I usually avoid tiff - the format is complex & there have always been compatibility issues between programs & platforms.

For editing a large image in GIMP, first make a cup of tea (or have a glass of water) and relax, light a candle to set the moode, take off your shoes, put on a gramaphone record of C P E Bach’s flute concerti.

Next, before opening the image, go to edit->preferences in gimp and set the file size. If you have 16G of RAM, and not much else going on (e.g. no Web browser, no 3d program!) you could try setting the tile cach size to 12 gigabytes. That will help.

Next, find the Undo History dockable dialogue. It has a button at the lower right (assuming a left-to-right locale; lower left in Arabic) which has a tooltip, “Remove all operations from the undo history”. Use this button frequently as you work - especially after making selection or doing anything like Curves that affects a large area. Saving the image (as xcf) will only take a few minutes, and is faster than exporting as png or tiff, so do that occasionally, and then you can reduce the importance of Undo.

It also helps to go to edit/preferences and siable thumbnails wherever you can.

Also, in the view menu, turn off “colour manage this view”.

In Windows, make sure you have plenty of spare disk space on the primary boot partition where the Windows swap file will go.

1 Like

We don’t know the properties of the images yet, so we won’t know which apps are suitable until we do.