8

Can any software deal with extremely large PNG files?

I have a 3500 x 827936 pixel PNG (a "fiche" style combination of multiple other images) and several pieces of software, such as Firefox, Chrome, Microsoft Paint, Paint 3D, Adobe Photoshop and Photos, all refuse to handle it, or mangle it on load and claim it is an invalid file. This is not true as the PNG specification allows the size of an image to be up to a 32-bit unsigned int in each dimension.

4
  • 12
    What, specifically, do you want to do with the image? View it, downscale it, crop it, convert it to some other format, something else? While you might be able to find a program that can do all of these things and can handle an image that big, for very large images it's also possible that you may need to resort to special-purpose tools that only support a limited set of operations. Aug 14 at 15:04
  • What are the resources on your machine in terms of RAM/processing power? It's possible this is as much a hardware problem as a software problem... Aug 14 at 18:48
  • IMHO, it's 31 bit and the 32nd bit is always 0. But doesn't really matter for the question. An RGB file of that size will take ~8.6 GB of memory. Aug 15 at 16:36
  • How did you get the image in the first place?
    – 7efkvNEq
    Aug 16 at 2:11

5 Answers 5

11

On Linux, one can try vipsdisp:

vipsdisp can display huge (many, many GB) images quickly and without using much memory. As well as the usual PNG, JPG, TIF, PDF, SVG, WEBP, JP2K, JXL and GIF, it supports many scientific and technical image formats, including SVS, MRXS, OpenEXR, FITS, Matlab, NIfTI, Analyze, PFM, etc. vipsdisp supports pixel types from 1 bit mono to 128-bit double precision complex, you can convert image formats, and it has a range of useful visualisation options and display modes.

I had a PNG of approximately half the size of yours, and it took 10 seconds to open it initially, but then zoom and scroll is pretty instantaneous.

If you want to do some editing and are okay with CLI tools, you can use libvips, which is used as a core of vispdisp. Unlike vispdisp, it is cross-platform and has downloads for Windows, but it might not be very convenient if you are used to GUI tools like Photoshop. You can use vips shrink to make a smaller version of the image if you want to take a glance. For complex manual edits, you can use vips crop to extract a part of the image into a new file, edit this file in your favorite editor, and then insert the edited version back into the original image using vips insert.

2
  • 1
    Yes I second vips. As a test I used it to generate a 100,000x100,000 PNG which ImageMagick (the normal goto batch image processing tool) refused to handle. The question still remains of what the question asker wants to do with such an image...
    – qwr
    Aug 14 at 23:48
  • @qwr I tried it with imagemagick and it works just fine, though it took 14 minutes and 100 GB temporary disk space or so on my aging server. The problem is that inkscape installs often have pathetically low default security limits on RAM and disk etc.
    – pipe
    Aug 16 at 18:53
8

I have had good experience with IrfanView in regards to opening images that appear as invalid in other editors.

Regarding the image size, it highly depends on your machine whether or not IrfanView can handle it. If it doesn't work, then try an editor that can load the file in chunks, like Vliv, which doesn't use much memory.

0
2

ImageMagick and VIPS were already mentioned. My first knee-jerk reaction would be to try ImageMagick's convert.

One framework which might also help you, but you most certainly would need to do some programming, is ITK. There are some Python bindings, nice if they work for you. If not, you are stuck with C++ and probably also re-building ITK yourself, and it does not feel quite nice. But if you are willing to invest some time into programming, you'd get any job done.

For further / easier programming interfaces, you can look into CImg or DevIL, but there are some caveats with image size, format, and compatibility.

At such image sizes you can basically forgo any visual interactive solution, such as Photoshop. It's a batch job, probably with extra RAM, zRAM, swapping, remote caches. (And ImageMagick and/or Linux kernel can be configured to do all this.) If ImageMagick and things built-in into VIPS do not work, you are stuck with ITK and examples from their documentation.

I would highly recommend to either downsample or cut the image into parts, if you can afford to do it. If not, it's a very special thing, home to biological image processing, geoimages and special stuff like that. You know who you are, but you'd be mostly either with people from your specific domain or completely on your own.

0

I am assuming you need to view (scroll through) and coarsely edit (e.g. crop, copy and paste parts of) your large PNG images under Windows OS. Therefore I would suggest that you try the following Free Open Source Software (FOSS):

There is no guarantee that any of these (raster image) software tools will work for you but at least you can try them without investing too much. Besides, it may be challenging or quite awkward, at first, to use command line tools to edit images as you need to supply numerical parameters, e.g. commands and coordinates, on the command line. So some examples might be useful: https://www.imagemagick.org/Usage/

If you do not have experience with Linux or *BSD Operating Systems (OS), and if, at the same time, you feel like Windows is limiting your abilities, then I would recommend you trying Ubuntu, which is a (particularly easy to operate) combination (a.k.a. distribution) of software based on Linux, GNU and other FOSS.

My warmest thanks go to all the authors and contributors of FOSS!

3
  • That's three answers. Please post each separately so they may be voted upon and accepted separately.
    – Chenmunka
    Aug 15 at 13:52
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Aug 15 at 13:53
  • @Chenmunka, thank you for your comment. Based on the "gaps" in the original question, namely: OS, hardware platform, hardware resources, use case details and user's skills required, I am just taking the liberty to suggest as wide set of options as possible. I feel like I can not answer such a general question in a way that is too specific.
    – embedeo
    Aug 17 at 7:08
-1

I have processed many hundreds of thousands of raster images in a fast batch. I can tell you that nothing matches Rasterex in raw power and speed. My memory doesn't allow me to tell you the exact max specs for PNG, but I am sure what you have named is ok, because what I dealt with was typically 30x42 (@400dpi) so 1200x16800 and frequently I would dump an oversized aircraft 1:1 page in, which could be 42"x12' or much longer at that same 400 dpi, and it would not even hick up.

One word of warning: Pay attention what OS you are using. In my experience nothing could beat Windows2000. Windows XP had the same limitation but bigger overhead and was noticeably slower. Forget about Windows ME, 8, 10, 11. Windows 7 would churn, but just so, throwing limitation errors.

This is because Microsoft had realized that they have sold to the people a commercial-power OS, capable of running anything, and yet the people mostly had no idea, so it was possible to take it back version by version, which was the true reason for the updates and the upgrades, by now everyone has just a weak OS, not capable of anything at all, and essentially just a platform on which to run the software they sell. So, if you think that limitations you see come from the software only, sometimes it is being triggered by the OS API calls and the regression is clearly observable.

Rasterex used to be sold for thousands of dollars to the Reprographics companies on CDS, with a hardware key for a parallel port. I expect some companies to still have it dusting in a software cabinet somewhere in the pile of windows 98 circa old refuse they own. Today, no one working there would be able to know what it is, and they would be happy to give it away just for asking.

I do not know if it has been produced or not. Last version I saw was a reversed engineered v2000 (I think) with all license code stripped. x32 and wont run on above XP.

Give it a try if you have a headache.

What you have is a fiche strip 8.75"x173' if at @400 when digitized. It could be at 600. I don't think fiche was ever mass scanned to digital at more than 600 dpi. Consecutively, your main issue is the length. You need to cut them up length wize, if everything else falls.

The only tool that has no length limitation is Reprodesk (Server, not free viewer), again for around 2000-2002. This tool used to come with massive and complicated licensing structure from Autodesk, and IIRC before 2002 was physically bound to an internal processor of a TDS digital printer produced by OCE. They cut if free when the processing power (then with Windows2000 was able to match that of the 2 tonne TDS printer circuit board).

There were some cracked versions too. Again start by asking old IT guys at old Reprographics shops for what they might have stored out of no desire to clean up.

Everything above failing, what you need to do is to use freelance coders who understand raster format images to make a simple utility just for you to arbitrarily cut the PNG into fragments say 42 inches long (the max print width of most digital printers), by opening as a file and inserting end of image tags and saving as pieces. This is totally possible if the guy actually knows what he is doing. The limitations will come up only when attempting to open as image for viewing. This is why you may have to cut arbitrarily.

Once you have pieces, batch process (saturation, etc, filtering etc, renaming etc) using anything or even those same Rasterex and Reprodesk, then line up and merge if necessary using either of them. Rasterex will process on the fly all the editing commands, and even some (automated) merging with batch scripting. Reprodesk really speeds up manual alignment, manual merging, and visual control before a RIP is committed. Rasterex again, can finally take them at once and batch auto de-skew determining the angle each time on the fly in milliseconds.

I am assuming you have thousands of these. This is what I would do. Good luck.

2
  • 10
    Your answer is a bit long, contains irrelevant information about obsolete OS systems but misses relevant information and links on the mentioned tools like where to get them, are they free or how many do you have to pay for them.
    – Robert
    Aug 14 at 11:49
  • 2
    A Windows 2000 solution may qualify as retro computing nowadays. If you want a "commercial-power OS" you should really look at Linux which is running on all the powerful workstations these days... [moderator's note: this comment was edited to keep things friendly and respectful... please be kind to everyone... thank you]
    – qwr
    Aug 14 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.