Asked by:
Is there a single-image size or resolution limit in HDMake?

Question
-
I have a .PNG file that looks like this:
SIZE: 8,235,114,902 bytes
identify -verbose "WRL 15 1A2.png"
Image: WRL 15 1A2.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 72224x64080+0+0
Resolution: 28.34x28.34
Print size: 2548.48x2261.12
Units: PixelsPerCentimeter
Type: TrueColor
Endianess: Undefined
Colorspace: RGBWhen I run hdmake, as in:
hdmake.exe" -src "..\WRL 15 1A2.png" -xmlflat temp2 -extension png -tileformat 2 -html
I get the message:
HDMake: ERROR - can't open source file ..\WRL 15 1A2.png
The next image down the pyramid was only 1,856,632,472 and worked fine. I guess I'll try a -crop split and see if it is only a limitation for a single file.
Update:7/29/11 12:00
I tried the four-way split and then used hdmake to put them back together. Might I say that the documentation for tiles leaves a little confusion in my mind. Would the following be clearer to anyone else:
-srcgrid grid_width grid_height images[1][1].{tif|jpg|png|wdp|bmp} ... images[1][width] ... images[height][1] ... images[height][width].{tif|jpg|png|wdp|bmp}
Hdmake was able to complete the tile operation for the 4 subimages produced by ImageMagick's "convert -crop" operation. So, I am tentatively assuming that "Yes, there appears to be a single-file size or resolution limitation."Unfortunately, the result has a black bar in it - the bottom of the first quarter (image[1][1]) is missing. Any feedback on the original question and/or the black bar phenomenon (which I am now debugging) would be appreciated.
Since the first quarter is 2,516,292,374 bytes, I am guessing that there is a 2GB limit to the size of a file. If so, this should be noted, since someone could theoretically waste a great deal of time discovering these kinds of things on their own. It also would have been nice if hdmake had reported an error.
Update:7/30/11 09:00
Ah... Finally. By splitting my 8GB image into 16 tiles using ImageMagic's "convert - crop" operation, as in:
convert "WRL 15 2A2.png" -crop 18056x16020 +repage "WRL_15_2A2_%d.png
This produces 16 subimages on the order of 600MB each. I was able to tile them in due order with:
hdmake -srcgridfile 4 4 "WRL 15 2A2.gdf" -xmlflat temp_png -extension png -tileformat 2 -html
And a list of the 16 subimage filenames listed 1 per line in "WRL 15 2A2.gdf", as in:
..\WRL_15_2A2_1.png
..\WRL_15_2A2_2.png
...
...\WRL_15_2A2_15.pngI was a little disappointed in the performance, I got:
HDMake: End -> opening source image(s) (took 1408 seconds)
HDMake: End -> saving output tiles (took 2416 seconds)Then I remembered to redirect the "TEMP" and "TMP" environment variables to a separate spindle with lots of room and got another 10% improvement:
HDMake: End -> opening source image(s) (took 1240 seconds)
HDMake: End -> saving output tiles (took 1962 seconds)Wow! I could swear I started seeing litle Mandelbrots when I zoomed into those cells far enough! This utility is a nice piece of work!
Thanks,
David
- Edited by David Rogers Sunday, July 31, 2011 2:29 AM
Friday, July 29, 2011 5:26 AM
All replies
-
hdmake is reliant on Windows to load images. If Windows Explorer can load it, then hdmake can. This looks like an 8GB png, I would be surprised if Windows or for that matter most image editing programs can handle it. Anyway the technique you used the split the images is what I would recommend. My first guess at the black bar phenomenon is that the source images are still probably pushing the limits of what we can handle. I would try splitting into 8 or 16 source tiles instead.
- Edited by Matt Uyttendaele Sunday, July 31, 2011 12:40 AM misspell
Saturday, July 30, 2011 11:10 PM -
Thanks Matt. Yes, I discovered that by trial and error. There should definately be some sort of helpful error when a file fails to load. And the "black bar" situation at about 2.2 GB should have generated an error too. But, as I said, this is great - I couldn't do this last week before I ran into HT Utils!
David
Sunday, July 31, 2011 12:31 AM -
How are you generating pngs this large? I tried getting Photoshop to create a 72224x64080 png file but it wouldn't. As I mentioned above, I think that you will find spotty support from most imaging tools when dealing with images above 100s of megapixels in the standard formats (jpg, tif, png). What most apps, including our Microsoft ICE, use for large files is the Adobe PSB (large document) format.
I appreciate that we should provide better error messages though. This is why I tried to get Photoshop to create a large png. I'd like to understand if our code or the Windows code is the one silently decoding black pixels in your test.
Sunday, July 31, 2011 8:57 PM -
The file starts out as a multi-mage TIFF file. Only one of the images is needed - the highest resolution. So, I extract that using ImageMagick into whatever format I want: jpg or png being the two I have tried. (For jpg, I have to extract in pieces to avoid the 65536 row/column limitation.)
The tif originatesd from this machine: http://www.bioimagene.com/products_solutions/whole_slide_scanners/iScan_coreo.html
Would it help if I sent you a ling to the image - it seems like it might be a good one for testing purposes?
After moving to the multiple tiles solution, I just ran into another problem, which is that I cannot seem to extract the files from the projectName.zip on another machine. I get a message:
WinZip
Error: too many entries in central directory according to end of central directory info.
When I examine the file with a downrev version of WinZip, it reports 65535 files - exactly. I am suspicious that not everything made it into the zip.
I will try the HDMake option to skip the zip.
David
- Edited by David Rogers Monday, August 1, 2011 8:46 PM
Monday, August 1, 2011 12:14 AM