How to view EXTREMELY large images?












6















I have a 1.8GB TIF image that I'm trying to open on my machine with Ubuntu 18.04.1 LTS. I have 8GB of RAM and 2GB of swap space. However, I can't open the image on the stock Gnome Image Viewer (says "Dimensions of TIFF image too large"), or Shotwell (says "Photo source file missing: "), or Gimp (bugs out), or on my Windows 7 VM with 4GB of RAM (says too little RAM even though it had over 2.5GB free), or feh, which behaves like the following:



$ feh DO_NOT_OPEN.tif
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
feh WARNING: DO_NOT_OPEN.tif - No Imlib2 loader for that file format
feh: No loadable images specified.
See 'man feh' for detailed usage information


Is there any way to open this image on Ubuntu?



(For the curious, the image is this one (https://www.spacetelescope.org/images/heic1502a/. I named it like that because the first time i tried to open it crashed my computer ¯_(ツ)_/¯ )



EDIT: Grammar.










share|improve this question























  • Also try imagemagic image editor. If it fails, try to scale image from command line without opening it, imagemagic can do it.

    – LeonidMew
    Jan 24 at 22:18











  • Btw, image opened fine in browser with zooming tool from that site.

    – LeonidMew
    Jan 24 at 22:22











  • Interesting picture :-)

    – sudodus
    Jan 25 at 18:07






  • 1





    Have you checked, if the download was successful, that your big tiff file matches the sha256sum (available at the website)? I think that gimp should work with your Ubuntu 18.04.1 LTS and 8 GiB RAM (and 2 GiB swap), because it works for me with 8GiB RAM (see my edited answer).

    – sudodus
    Jan 25 at 18:49











  • Why don't you try their zoomable viewer: spacetelescope.org/images/heic1502a/zoomable

    – stackzebra
    Jan 30 at 14:20
















6















I have a 1.8GB TIF image that I'm trying to open on my machine with Ubuntu 18.04.1 LTS. I have 8GB of RAM and 2GB of swap space. However, I can't open the image on the stock Gnome Image Viewer (says "Dimensions of TIFF image too large"), or Shotwell (says "Photo source file missing: "), or Gimp (bugs out), or on my Windows 7 VM with 4GB of RAM (says too little RAM even though it had over 2.5GB free), or feh, which behaves like the following:



$ feh DO_NOT_OPEN.tif
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
feh WARNING: DO_NOT_OPEN.tif - No Imlib2 loader for that file format
feh: No loadable images specified.
See 'man feh' for detailed usage information


Is there any way to open this image on Ubuntu?



(For the curious, the image is this one (https://www.spacetelescope.org/images/heic1502a/. I named it like that because the first time i tried to open it crashed my computer ¯_(ツ)_/¯ )



EDIT: Grammar.










share|improve this question























  • Also try imagemagic image editor. If it fails, try to scale image from command line without opening it, imagemagic can do it.

    – LeonidMew
    Jan 24 at 22:18











  • Btw, image opened fine in browser with zooming tool from that site.

    – LeonidMew
    Jan 24 at 22:22











  • Interesting picture :-)

    – sudodus
    Jan 25 at 18:07






  • 1





    Have you checked, if the download was successful, that your big tiff file matches the sha256sum (available at the website)? I think that gimp should work with your Ubuntu 18.04.1 LTS and 8 GiB RAM (and 2 GiB swap), because it works for me with 8GiB RAM (see my edited answer).

    – sudodus
    Jan 25 at 18:49











  • Why don't you try their zoomable viewer: spacetelescope.org/images/heic1502a/zoomable

    – stackzebra
    Jan 30 at 14:20














6












6








6


3






I have a 1.8GB TIF image that I'm trying to open on my machine with Ubuntu 18.04.1 LTS. I have 8GB of RAM and 2GB of swap space. However, I can't open the image on the stock Gnome Image Viewer (says "Dimensions of TIFF image too large"), or Shotwell (says "Photo source file missing: "), or Gimp (bugs out), or on my Windows 7 VM with 4GB of RAM (says too little RAM even though it had over 2.5GB free), or feh, which behaves like the following:



$ feh DO_NOT_OPEN.tif
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
feh WARNING: DO_NOT_OPEN.tif - No Imlib2 loader for that file format
feh: No loadable images specified.
See 'man feh' for detailed usage information


Is there any way to open this image on Ubuntu?



(For the curious, the image is this one (https://www.spacetelescope.org/images/heic1502a/. I named it like that because the first time i tried to open it crashed my computer ¯_(ツ)_/¯ )



EDIT: Grammar.










share|improve this question














I have a 1.8GB TIF image that I'm trying to open on my machine with Ubuntu 18.04.1 LTS. I have 8GB of RAM and 2GB of swap space. However, I can't open the image on the stock Gnome Image Viewer (says "Dimensions of TIFF image too large"), or Shotwell (says "Photo source file missing: "), or Gimp (bugs out), or on my Windows 7 VM with 4GB of RAM (says too little RAM even though it had over 2.5GB free), or feh, which behaves like the following:



$ feh DO_NOT_OPEN.tif
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
feh WARNING: DO_NOT_OPEN.tif - No Imlib2 loader for that file format
feh: No loadable images specified.
See 'man feh' for detailed usage information


Is there any way to open this image on Ubuntu?



(For the curious, the image is this one (https://www.spacetelescope.org/images/heic1502a/. I named it like that because the first time i tried to open it crashed my computer ¯_(ツ)_/¯ )



EDIT: Grammar.







gimp images shotwell image-viewer






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 24 at 22:06









MichaelMichael

333




333













  • Also try imagemagic image editor. If it fails, try to scale image from command line without opening it, imagemagic can do it.

    – LeonidMew
    Jan 24 at 22:18











  • Btw, image opened fine in browser with zooming tool from that site.

    – LeonidMew
    Jan 24 at 22:22











  • Interesting picture :-)

    – sudodus
    Jan 25 at 18:07






  • 1





    Have you checked, if the download was successful, that your big tiff file matches the sha256sum (available at the website)? I think that gimp should work with your Ubuntu 18.04.1 LTS and 8 GiB RAM (and 2 GiB swap), because it works for me with 8GiB RAM (see my edited answer).

    – sudodus
    Jan 25 at 18:49











  • Why don't you try their zoomable viewer: spacetelescope.org/images/heic1502a/zoomable

    – stackzebra
    Jan 30 at 14:20



















  • Also try imagemagic image editor. If it fails, try to scale image from command line without opening it, imagemagic can do it.

    – LeonidMew
    Jan 24 at 22:18











  • Btw, image opened fine in browser with zooming tool from that site.

    – LeonidMew
    Jan 24 at 22:22











  • Interesting picture :-)

    – sudodus
    Jan 25 at 18:07






  • 1





    Have you checked, if the download was successful, that your big tiff file matches the sha256sum (available at the website)? I think that gimp should work with your Ubuntu 18.04.1 LTS and 8 GiB RAM (and 2 GiB swap), because it works for me with 8GiB RAM (see my edited answer).

    – sudodus
    Jan 25 at 18:49











  • Why don't you try their zoomable viewer: spacetelescope.org/images/heic1502a/zoomable

    – stackzebra
    Jan 30 at 14:20

















Also try imagemagic image editor. If it fails, try to scale image from command line without opening it, imagemagic can do it.

– LeonidMew
Jan 24 at 22:18





Also try imagemagic image editor. If it fails, try to scale image from command line without opening it, imagemagic can do it.

– LeonidMew
Jan 24 at 22:18













Btw, image opened fine in browser with zooming tool from that site.

– LeonidMew
Jan 24 at 22:22





Btw, image opened fine in browser with zooming tool from that site.

– LeonidMew
Jan 24 at 22:22













Interesting picture :-)

– sudodus
Jan 25 at 18:07





Interesting picture :-)

– sudodus
Jan 25 at 18:07




1




1





Have you checked, if the download was successful, that your big tiff file matches the sha256sum (available at the website)? I think that gimp should work with your Ubuntu 18.04.1 LTS and 8 GiB RAM (and 2 GiB swap), because it works for me with 8GiB RAM (see my edited answer).

– sudodus
Jan 25 at 18:49





Have you checked, if the download was successful, that your big tiff file matches the sha256sum (available at the website)? I think that gimp should work with your Ubuntu 18.04.1 LTS and 8 GiB RAM (and 2 GiB swap), because it works for me with 8GiB RAM (see my edited answer).

– sudodus
Jan 25 at 18:49













Why don't you try their zoomable viewer: spacetelescope.org/images/heic1502a/zoomable

– stackzebra
Jan 30 at 14:20





Why don't you try their zoomable viewer: spacetelescope.org/images/heic1502a/zoomable

– stackzebra
Jan 30 at 14:20










2 Answers
2






active

oldest

votes


















3














Why can't I open the image in any viewer?



The issue is probably RAM and/or CPU.



The TIFF image is LZW-compressed. When an application wants to display it, it needs to uncompress the image first. And that's where RAM and CPU come into play. Furthermore, depending on the application, there may be buffers that also need RAM.



I did some (non-scientific) experiments and noticed differences between applications in three phases: when loading the image, after loading the image, when zooming in.



Shotwell took up to 5GB of RAM while opening the file and then dropped to 2GB. When I zoomed in, it went up to 7GB.



Gimp went up to 5GB and stayed there when viewing the image and zooming in. The RAM usage gradually increased when editing the image.



GwenView went up to 3.8GB while loading and dropped to 2GB afterwards. When zooming in, it went up to 2.7GB.



Your best bet is trying GwenView (the default image viewer in Kubuntu, but can be installed in stock Ubuntu as well).



What options do I have if the image is way too big for RAM?



In general, if the image is too big to fit into RAM, you can split it using convert which is part of the imagemagick package.



You need to increase the default limits which are defined in /etc/ImageMagick-6/policy.xml (the number 6 may change in future versions). You need to adjust the maximum size in pixels, which are defined in the following lines:



<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>


KP means KiloPixels, i.e. thousand pixels. In your case, the image has 40000x12788 pixels, so you only need to change the width to something greater than 40KP, e.g. 41KP.



Additionally, you need to increase the maximum disk space:



<policy domain="resource" name="disk" value="1GiB"/>


to something reasonable like 10GiB.



To split the image into 5x3 parts and produce one file per part, use the following command:



convert -crop 5x3@ inputfile.tif outputfile%0d.tif


For more information about convert, see man convert or take a look at the documentation.





Maybe a bit off topic, but here's a quick&dirty bash script that tiles an image and creates an html page that displays an overview where you can click on a tile to open it in full resolution. Save it as e.g. tile_image.sh and invoke it like ./tile_image.sh originalImage tilesX tilesY, where tilesX is the number of tiles horizontally and tilesY is the number of tiles vertically.



#!/bin/bash
INPUT_FILE=$1
TILES_X=$2
TILES_Y=$3
OUTPUT_FILE=${INPUT_FILE%.*}_tile_%0d.png
convert -crop $TILES_X"x"$TILES_Y@ $INPUT_FILE $OUTPUT_FILE
HTML_FILE=${INPUT_FILE%.*}_tile_view.html
echo "<html><body><style type="text/css">table,tr,td,a {padding:0;border-spacing:0} img:hover {opacity:.9}</style><table>" > $HTML_FILE
X=0
Y=0
while [ $Y -lt $TILES_Y ]; do
echo "<tr>" >> $HTML_FILE
while [ $X -lt $TILES_X ]; do
TILE_NUMBER=$(echo $Y*$TILES_X+$X | bc -l)
TILE_NAME=${INPUT_FILE%.*}_tile_$TILE_NUMBER.png
THUMBNAIL=${INPUT_FILE%.*}_tile_$TILE_NUMBER"_thumb.png"
convert -resize 100x100 $TILE_NAME $THUMBNAIL
echo "<td><a href=""$(basename $TILE_NAME)""><img src=""$(basename $THUMBNAIL)""></a></td>" >> $HTML_FILE
let X=X+1
done
let X=0
echo "</tr>" >> $HTML_FILE
let Y=Y+1
done
echo "</table></body></html>" >> $HTML_FILE





share|improve this answer


























  • Nice bash script to make the picture available when there is not enough RAM :-) I upvoted your answer already, but would do it again, if possible.

    – sudodus
    Jan 25 at 19:29











  • Well, as noted by @sudodus, my mistake was not checking the download and trying to open a corrupt image. Turns out, gimp and shotwell can both open it, ImageViewer still crashes. However, my mistake aside, this is a great answer and the script worked wonderfully, and thus I'm marking it as accepted :)

    – Michael
    Jan 30 at 18:53



















2














Test



I tested to view the 1.7 GiB Tiff file in a Dell Precision M4800 with 16 GiB RAM and Ubuntu 18.04.1 LTS with Wayland. I tested with gimp also in a Dell Latitude E7240 with 8 GiB RAM and 18.04.1 LTS persistent live with Xorg.



The total RAM usage including operating system is measured with free -m.




  • gimp - works best for me also at full resolution (without delay), 6143 MiB RAM. It works well both with 16 GiB RAM and 8 GiB RAM.


  • shotwell - works also at full resolution (without delay), 7920 MiB RAM (after some horizontal and vertical scrolling at full resolution)


  • gpicview - works but slower (failed to show full resolution directly, but works when gradually zooming in to full resolution, total RAM usage when showing and zooming 3016 MiB RAM, but 4219 MiB RAM during loading.


  • feh - does not work 'No ImLib2 loader for that file format'



  • eog - does not work 'too big image'


  • ristretto - does not work (silently, shows a thumbnail, but no picture)


Conclusion



It should work with Ubuntu and 8 GiB RAM to view this picture with several viewers, and the editor gimp works really well for me. With 6 GiB RAM, you should select a light-weight viewer, and with 4 GiB probably be prepared to wait for some swapping.



Please notice that I have measured the total usage of RAM (including the operating system).



Final comment



This is a great picture well worth zooming into with the tools, that you have available. I should add that the zoom tool of the web site works well with Firefox for me in a computer with 4 GB RAM, I could reach a zoom level corresponding to full resolution of the 1.7 GB Tiff file and I could scroll horizontally and vertically to see the whole picture.






share|improve this answer


























  • I'm impressed that you took the time to download a 1.7GB picture

    – Charles Green
    Jan 25 at 19:00











  • @CharlesGreen, Well, with ~10 MB/s it is only 1700/10 seconds ~ 3 minutes (not too long). And it is a great picture :-)

    – sudodus
    Jan 25 at 19:11













  • I'm at the end of a not-very-fast DLS link - they say 10 Mb/s so...24 minutes? But firefox says ~ 3 hours....

    – Charles Green
    Jan 25 at 19:13











  • @CharlesGreen, I was lucky, the website was not busy, so it could send at high speed. I hope your speed will increase within a few minutes.

    – sudodus
    Jan 25 at 19:17











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112641%2fhow-to-view-extremely-large-images%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














Why can't I open the image in any viewer?



The issue is probably RAM and/or CPU.



The TIFF image is LZW-compressed. When an application wants to display it, it needs to uncompress the image first. And that's where RAM and CPU come into play. Furthermore, depending on the application, there may be buffers that also need RAM.



I did some (non-scientific) experiments and noticed differences between applications in three phases: when loading the image, after loading the image, when zooming in.



Shotwell took up to 5GB of RAM while opening the file and then dropped to 2GB. When I zoomed in, it went up to 7GB.



Gimp went up to 5GB and stayed there when viewing the image and zooming in. The RAM usage gradually increased when editing the image.



GwenView went up to 3.8GB while loading and dropped to 2GB afterwards. When zooming in, it went up to 2.7GB.



Your best bet is trying GwenView (the default image viewer in Kubuntu, but can be installed in stock Ubuntu as well).



What options do I have if the image is way too big for RAM?



In general, if the image is too big to fit into RAM, you can split it using convert which is part of the imagemagick package.



You need to increase the default limits which are defined in /etc/ImageMagick-6/policy.xml (the number 6 may change in future versions). You need to adjust the maximum size in pixels, which are defined in the following lines:



<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>


KP means KiloPixels, i.e. thousand pixels. In your case, the image has 40000x12788 pixels, so you only need to change the width to something greater than 40KP, e.g. 41KP.



Additionally, you need to increase the maximum disk space:



<policy domain="resource" name="disk" value="1GiB"/>


to something reasonable like 10GiB.



To split the image into 5x3 parts and produce one file per part, use the following command:



convert -crop 5x3@ inputfile.tif outputfile%0d.tif


For more information about convert, see man convert or take a look at the documentation.





Maybe a bit off topic, but here's a quick&dirty bash script that tiles an image and creates an html page that displays an overview where you can click on a tile to open it in full resolution. Save it as e.g. tile_image.sh and invoke it like ./tile_image.sh originalImage tilesX tilesY, where tilesX is the number of tiles horizontally and tilesY is the number of tiles vertically.



#!/bin/bash
INPUT_FILE=$1
TILES_X=$2
TILES_Y=$3
OUTPUT_FILE=${INPUT_FILE%.*}_tile_%0d.png
convert -crop $TILES_X"x"$TILES_Y@ $INPUT_FILE $OUTPUT_FILE
HTML_FILE=${INPUT_FILE%.*}_tile_view.html
echo "<html><body><style type="text/css">table,tr,td,a {padding:0;border-spacing:0} img:hover {opacity:.9}</style><table>" > $HTML_FILE
X=0
Y=0
while [ $Y -lt $TILES_Y ]; do
echo "<tr>" >> $HTML_FILE
while [ $X -lt $TILES_X ]; do
TILE_NUMBER=$(echo $Y*$TILES_X+$X | bc -l)
TILE_NAME=${INPUT_FILE%.*}_tile_$TILE_NUMBER.png
THUMBNAIL=${INPUT_FILE%.*}_tile_$TILE_NUMBER"_thumb.png"
convert -resize 100x100 $TILE_NAME $THUMBNAIL
echo "<td><a href=""$(basename $TILE_NAME)""><img src=""$(basename $THUMBNAIL)""></a></td>" >> $HTML_FILE
let X=X+1
done
let X=0
echo "</tr>" >> $HTML_FILE
let Y=Y+1
done
echo "</table></body></html>" >> $HTML_FILE





share|improve this answer


























  • Nice bash script to make the picture available when there is not enough RAM :-) I upvoted your answer already, but would do it again, if possible.

    – sudodus
    Jan 25 at 19:29











  • Well, as noted by @sudodus, my mistake was not checking the download and trying to open a corrupt image. Turns out, gimp and shotwell can both open it, ImageViewer still crashes. However, my mistake aside, this is a great answer and the script worked wonderfully, and thus I'm marking it as accepted :)

    – Michael
    Jan 30 at 18:53
















3














Why can't I open the image in any viewer?



The issue is probably RAM and/or CPU.



The TIFF image is LZW-compressed. When an application wants to display it, it needs to uncompress the image first. And that's where RAM and CPU come into play. Furthermore, depending on the application, there may be buffers that also need RAM.



I did some (non-scientific) experiments and noticed differences between applications in three phases: when loading the image, after loading the image, when zooming in.



Shotwell took up to 5GB of RAM while opening the file and then dropped to 2GB. When I zoomed in, it went up to 7GB.



Gimp went up to 5GB and stayed there when viewing the image and zooming in. The RAM usage gradually increased when editing the image.



GwenView went up to 3.8GB while loading and dropped to 2GB afterwards. When zooming in, it went up to 2.7GB.



Your best bet is trying GwenView (the default image viewer in Kubuntu, but can be installed in stock Ubuntu as well).



What options do I have if the image is way too big for RAM?



In general, if the image is too big to fit into RAM, you can split it using convert which is part of the imagemagick package.



You need to increase the default limits which are defined in /etc/ImageMagick-6/policy.xml (the number 6 may change in future versions). You need to adjust the maximum size in pixels, which are defined in the following lines:



<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>


KP means KiloPixels, i.e. thousand pixels. In your case, the image has 40000x12788 pixels, so you only need to change the width to something greater than 40KP, e.g. 41KP.



Additionally, you need to increase the maximum disk space:



<policy domain="resource" name="disk" value="1GiB"/>


to something reasonable like 10GiB.



To split the image into 5x3 parts and produce one file per part, use the following command:



convert -crop 5x3@ inputfile.tif outputfile%0d.tif


For more information about convert, see man convert or take a look at the documentation.





Maybe a bit off topic, but here's a quick&dirty bash script that tiles an image and creates an html page that displays an overview where you can click on a tile to open it in full resolution. Save it as e.g. tile_image.sh and invoke it like ./tile_image.sh originalImage tilesX tilesY, where tilesX is the number of tiles horizontally and tilesY is the number of tiles vertically.



#!/bin/bash
INPUT_FILE=$1
TILES_X=$2
TILES_Y=$3
OUTPUT_FILE=${INPUT_FILE%.*}_tile_%0d.png
convert -crop $TILES_X"x"$TILES_Y@ $INPUT_FILE $OUTPUT_FILE
HTML_FILE=${INPUT_FILE%.*}_tile_view.html
echo "<html><body><style type="text/css">table,tr,td,a {padding:0;border-spacing:0} img:hover {opacity:.9}</style><table>" > $HTML_FILE
X=0
Y=0
while [ $Y -lt $TILES_Y ]; do
echo "<tr>" >> $HTML_FILE
while [ $X -lt $TILES_X ]; do
TILE_NUMBER=$(echo $Y*$TILES_X+$X | bc -l)
TILE_NAME=${INPUT_FILE%.*}_tile_$TILE_NUMBER.png
THUMBNAIL=${INPUT_FILE%.*}_tile_$TILE_NUMBER"_thumb.png"
convert -resize 100x100 $TILE_NAME $THUMBNAIL
echo "<td><a href=""$(basename $TILE_NAME)""><img src=""$(basename $THUMBNAIL)""></a></td>" >> $HTML_FILE
let X=X+1
done
let X=0
echo "</tr>" >> $HTML_FILE
let Y=Y+1
done
echo "</table></body></html>" >> $HTML_FILE





share|improve this answer


























  • Nice bash script to make the picture available when there is not enough RAM :-) I upvoted your answer already, but would do it again, if possible.

    – sudodus
    Jan 25 at 19:29











  • Well, as noted by @sudodus, my mistake was not checking the download and trying to open a corrupt image. Turns out, gimp and shotwell can both open it, ImageViewer still crashes. However, my mistake aside, this is a great answer and the script worked wonderfully, and thus I'm marking it as accepted :)

    – Michael
    Jan 30 at 18:53














3












3








3







Why can't I open the image in any viewer?



The issue is probably RAM and/or CPU.



The TIFF image is LZW-compressed. When an application wants to display it, it needs to uncompress the image first. And that's where RAM and CPU come into play. Furthermore, depending on the application, there may be buffers that also need RAM.



I did some (non-scientific) experiments and noticed differences between applications in three phases: when loading the image, after loading the image, when zooming in.



Shotwell took up to 5GB of RAM while opening the file and then dropped to 2GB. When I zoomed in, it went up to 7GB.



Gimp went up to 5GB and stayed there when viewing the image and zooming in. The RAM usage gradually increased when editing the image.



GwenView went up to 3.8GB while loading and dropped to 2GB afterwards. When zooming in, it went up to 2.7GB.



Your best bet is trying GwenView (the default image viewer in Kubuntu, but can be installed in stock Ubuntu as well).



What options do I have if the image is way too big for RAM?



In general, if the image is too big to fit into RAM, you can split it using convert which is part of the imagemagick package.



You need to increase the default limits which are defined in /etc/ImageMagick-6/policy.xml (the number 6 may change in future versions). You need to adjust the maximum size in pixels, which are defined in the following lines:



<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>


KP means KiloPixels, i.e. thousand pixels. In your case, the image has 40000x12788 pixels, so you only need to change the width to something greater than 40KP, e.g. 41KP.



Additionally, you need to increase the maximum disk space:



<policy domain="resource" name="disk" value="1GiB"/>


to something reasonable like 10GiB.



To split the image into 5x3 parts and produce one file per part, use the following command:



convert -crop 5x3@ inputfile.tif outputfile%0d.tif


For more information about convert, see man convert or take a look at the documentation.





Maybe a bit off topic, but here's a quick&dirty bash script that tiles an image and creates an html page that displays an overview where you can click on a tile to open it in full resolution. Save it as e.g. tile_image.sh and invoke it like ./tile_image.sh originalImage tilesX tilesY, where tilesX is the number of tiles horizontally and tilesY is the number of tiles vertically.



#!/bin/bash
INPUT_FILE=$1
TILES_X=$2
TILES_Y=$3
OUTPUT_FILE=${INPUT_FILE%.*}_tile_%0d.png
convert -crop $TILES_X"x"$TILES_Y@ $INPUT_FILE $OUTPUT_FILE
HTML_FILE=${INPUT_FILE%.*}_tile_view.html
echo "<html><body><style type="text/css">table,tr,td,a {padding:0;border-spacing:0} img:hover {opacity:.9}</style><table>" > $HTML_FILE
X=0
Y=0
while [ $Y -lt $TILES_Y ]; do
echo "<tr>" >> $HTML_FILE
while [ $X -lt $TILES_X ]; do
TILE_NUMBER=$(echo $Y*$TILES_X+$X | bc -l)
TILE_NAME=${INPUT_FILE%.*}_tile_$TILE_NUMBER.png
THUMBNAIL=${INPUT_FILE%.*}_tile_$TILE_NUMBER"_thumb.png"
convert -resize 100x100 $TILE_NAME $THUMBNAIL
echo "<td><a href=""$(basename $TILE_NAME)""><img src=""$(basename $THUMBNAIL)""></a></td>" >> $HTML_FILE
let X=X+1
done
let X=0
echo "</tr>" >> $HTML_FILE
let Y=Y+1
done
echo "</table></body></html>" >> $HTML_FILE





share|improve this answer















Why can't I open the image in any viewer?



The issue is probably RAM and/or CPU.



The TIFF image is LZW-compressed. When an application wants to display it, it needs to uncompress the image first. And that's where RAM and CPU come into play. Furthermore, depending on the application, there may be buffers that also need RAM.



I did some (non-scientific) experiments and noticed differences between applications in three phases: when loading the image, after loading the image, when zooming in.



Shotwell took up to 5GB of RAM while opening the file and then dropped to 2GB. When I zoomed in, it went up to 7GB.



Gimp went up to 5GB and stayed there when viewing the image and zooming in. The RAM usage gradually increased when editing the image.



GwenView went up to 3.8GB while loading and dropped to 2GB afterwards. When zooming in, it went up to 2.7GB.



Your best bet is trying GwenView (the default image viewer in Kubuntu, but can be installed in stock Ubuntu as well).



What options do I have if the image is way too big for RAM?



In general, if the image is too big to fit into RAM, you can split it using convert which is part of the imagemagick package.



You need to increase the default limits which are defined in /etc/ImageMagick-6/policy.xml (the number 6 may change in future versions). You need to adjust the maximum size in pixels, which are defined in the following lines:



<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>


KP means KiloPixels, i.e. thousand pixels. In your case, the image has 40000x12788 pixels, so you only need to change the width to something greater than 40KP, e.g. 41KP.



Additionally, you need to increase the maximum disk space:



<policy domain="resource" name="disk" value="1GiB"/>


to something reasonable like 10GiB.



To split the image into 5x3 parts and produce one file per part, use the following command:



convert -crop 5x3@ inputfile.tif outputfile%0d.tif


For more information about convert, see man convert or take a look at the documentation.





Maybe a bit off topic, but here's a quick&dirty bash script that tiles an image and creates an html page that displays an overview where you can click on a tile to open it in full resolution. Save it as e.g. tile_image.sh and invoke it like ./tile_image.sh originalImage tilesX tilesY, where tilesX is the number of tiles horizontally and tilesY is the number of tiles vertically.



#!/bin/bash
INPUT_FILE=$1
TILES_X=$2
TILES_Y=$3
OUTPUT_FILE=${INPUT_FILE%.*}_tile_%0d.png
convert -crop $TILES_X"x"$TILES_Y@ $INPUT_FILE $OUTPUT_FILE
HTML_FILE=${INPUT_FILE%.*}_tile_view.html
echo "<html><body><style type="text/css">table,tr,td,a {padding:0;border-spacing:0} img:hover {opacity:.9}</style><table>" > $HTML_FILE
X=0
Y=0
while [ $Y -lt $TILES_Y ]; do
echo "<tr>" >> $HTML_FILE
while [ $X -lt $TILES_X ]; do
TILE_NUMBER=$(echo $Y*$TILES_X+$X | bc -l)
TILE_NAME=${INPUT_FILE%.*}_tile_$TILE_NUMBER.png
THUMBNAIL=${INPUT_FILE%.*}_tile_$TILE_NUMBER"_thumb.png"
convert -resize 100x100 $TILE_NAME $THUMBNAIL
echo "<td><a href=""$(basename $TILE_NAME)""><img src=""$(basename $THUMBNAIL)""></a></td>" >> $HTML_FILE
let X=X+1
done
let X=0
echo "</tr>" >> $HTML_FILE
let Y=Y+1
done
echo "</table></body></html>" >> $HTML_FILE






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 25 at 18:27

























answered Jan 25 at 11:02









danzeldanzel

2,067714




2,067714













  • Nice bash script to make the picture available when there is not enough RAM :-) I upvoted your answer already, but would do it again, if possible.

    – sudodus
    Jan 25 at 19:29











  • Well, as noted by @sudodus, my mistake was not checking the download and trying to open a corrupt image. Turns out, gimp and shotwell can both open it, ImageViewer still crashes. However, my mistake aside, this is a great answer and the script worked wonderfully, and thus I'm marking it as accepted :)

    – Michael
    Jan 30 at 18:53



















  • Nice bash script to make the picture available when there is not enough RAM :-) I upvoted your answer already, but would do it again, if possible.

    – sudodus
    Jan 25 at 19:29











  • Well, as noted by @sudodus, my mistake was not checking the download and trying to open a corrupt image. Turns out, gimp and shotwell can both open it, ImageViewer still crashes. However, my mistake aside, this is a great answer and the script worked wonderfully, and thus I'm marking it as accepted :)

    – Michael
    Jan 30 at 18:53

















Nice bash script to make the picture available when there is not enough RAM :-) I upvoted your answer already, but would do it again, if possible.

– sudodus
Jan 25 at 19:29





Nice bash script to make the picture available when there is not enough RAM :-) I upvoted your answer already, but would do it again, if possible.

– sudodus
Jan 25 at 19:29













Well, as noted by @sudodus, my mistake was not checking the download and trying to open a corrupt image. Turns out, gimp and shotwell can both open it, ImageViewer still crashes. However, my mistake aside, this is a great answer and the script worked wonderfully, and thus I'm marking it as accepted :)

– Michael
Jan 30 at 18:53





Well, as noted by @sudodus, my mistake was not checking the download and trying to open a corrupt image. Turns out, gimp and shotwell can both open it, ImageViewer still crashes. However, my mistake aside, this is a great answer and the script worked wonderfully, and thus I'm marking it as accepted :)

– Michael
Jan 30 at 18:53













2














Test



I tested to view the 1.7 GiB Tiff file in a Dell Precision M4800 with 16 GiB RAM and Ubuntu 18.04.1 LTS with Wayland. I tested with gimp also in a Dell Latitude E7240 with 8 GiB RAM and 18.04.1 LTS persistent live with Xorg.



The total RAM usage including operating system is measured with free -m.




  • gimp - works best for me also at full resolution (without delay), 6143 MiB RAM. It works well both with 16 GiB RAM and 8 GiB RAM.


  • shotwell - works also at full resolution (without delay), 7920 MiB RAM (after some horizontal and vertical scrolling at full resolution)


  • gpicview - works but slower (failed to show full resolution directly, but works when gradually zooming in to full resolution, total RAM usage when showing and zooming 3016 MiB RAM, but 4219 MiB RAM during loading.


  • feh - does not work 'No ImLib2 loader for that file format'



  • eog - does not work 'too big image'


  • ristretto - does not work (silently, shows a thumbnail, but no picture)


Conclusion



It should work with Ubuntu and 8 GiB RAM to view this picture with several viewers, and the editor gimp works really well for me. With 6 GiB RAM, you should select a light-weight viewer, and with 4 GiB probably be prepared to wait for some swapping.



Please notice that I have measured the total usage of RAM (including the operating system).



Final comment



This is a great picture well worth zooming into with the tools, that you have available. I should add that the zoom tool of the web site works well with Firefox for me in a computer with 4 GB RAM, I could reach a zoom level corresponding to full resolution of the 1.7 GB Tiff file and I could scroll horizontally and vertically to see the whole picture.






share|improve this answer


























  • I'm impressed that you took the time to download a 1.7GB picture

    – Charles Green
    Jan 25 at 19:00











  • @CharlesGreen, Well, with ~10 MB/s it is only 1700/10 seconds ~ 3 minutes (not too long). And it is a great picture :-)

    – sudodus
    Jan 25 at 19:11













  • I'm at the end of a not-very-fast DLS link - they say 10 Mb/s so...24 minutes? But firefox says ~ 3 hours....

    – Charles Green
    Jan 25 at 19:13











  • @CharlesGreen, I was lucky, the website was not busy, so it could send at high speed. I hope your speed will increase within a few minutes.

    – sudodus
    Jan 25 at 19:17
















2














Test



I tested to view the 1.7 GiB Tiff file in a Dell Precision M4800 with 16 GiB RAM and Ubuntu 18.04.1 LTS with Wayland. I tested with gimp also in a Dell Latitude E7240 with 8 GiB RAM and 18.04.1 LTS persistent live with Xorg.



The total RAM usage including operating system is measured with free -m.




  • gimp - works best for me also at full resolution (without delay), 6143 MiB RAM. It works well both with 16 GiB RAM and 8 GiB RAM.


  • shotwell - works also at full resolution (without delay), 7920 MiB RAM (after some horizontal and vertical scrolling at full resolution)


  • gpicview - works but slower (failed to show full resolution directly, but works when gradually zooming in to full resolution, total RAM usage when showing and zooming 3016 MiB RAM, but 4219 MiB RAM during loading.


  • feh - does not work 'No ImLib2 loader for that file format'



  • eog - does not work 'too big image'


  • ristretto - does not work (silently, shows a thumbnail, but no picture)


Conclusion



It should work with Ubuntu and 8 GiB RAM to view this picture with several viewers, and the editor gimp works really well for me. With 6 GiB RAM, you should select a light-weight viewer, and with 4 GiB probably be prepared to wait for some swapping.



Please notice that I have measured the total usage of RAM (including the operating system).



Final comment



This is a great picture well worth zooming into with the tools, that you have available. I should add that the zoom tool of the web site works well with Firefox for me in a computer with 4 GB RAM, I could reach a zoom level corresponding to full resolution of the 1.7 GB Tiff file and I could scroll horizontally and vertically to see the whole picture.






share|improve this answer


























  • I'm impressed that you took the time to download a 1.7GB picture

    – Charles Green
    Jan 25 at 19:00











  • @CharlesGreen, Well, with ~10 MB/s it is only 1700/10 seconds ~ 3 minutes (not too long). And it is a great picture :-)

    – sudodus
    Jan 25 at 19:11













  • I'm at the end of a not-very-fast DLS link - they say 10 Mb/s so...24 minutes? But firefox says ~ 3 hours....

    – Charles Green
    Jan 25 at 19:13











  • @CharlesGreen, I was lucky, the website was not busy, so it could send at high speed. I hope your speed will increase within a few minutes.

    – sudodus
    Jan 25 at 19:17














2












2








2







Test



I tested to view the 1.7 GiB Tiff file in a Dell Precision M4800 with 16 GiB RAM and Ubuntu 18.04.1 LTS with Wayland. I tested with gimp also in a Dell Latitude E7240 with 8 GiB RAM and 18.04.1 LTS persistent live with Xorg.



The total RAM usage including operating system is measured with free -m.




  • gimp - works best for me also at full resolution (without delay), 6143 MiB RAM. It works well both with 16 GiB RAM and 8 GiB RAM.


  • shotwell - works also at full resolution (without delay), 7920 MiB RAM (after some horizontal and vertical scrolling at full resolution)


  • gpicview - works but slower (failed to show full resolution directly, but works when gradually zooming in to full resolution, total RAM usage when showing and zooming 3016 MiB RAM, but 4219 MiB RAM during loading.


  • feh - does not work 'No ImLib2 loader for that file format'



  • eog - does not work 'too big image'


  • ristretto - does not work (silently, shows a thumbnail, but no picture)


Conclusion



It should work with Ubuntu and 8 GiB RAM to view this picture with several viewers, and the editor gimp works really well for me. With 6 GiB RAM, you should select a light-weight viewer, and with 4 GiB probably be prepared to wait for some swapping.



Please notice that I have measured the total usage of RAM (including the operating system).



Final comment



This is a great picture well worth zooming into with the tools, that you have available. I should add that the zoom tool of the web site works well with Firefox for me in a computer with 4 GB RAM, I could reach a zoom level corresponding to full resolution of the 1.7 GB Tiff file and I could scroll horizontally and vertically to see the whole picture.






share|improve this answer















Test



I tested to view the 1.7 GiB Tiff file in a Dell Precision M4800 with 16 GiB RAM and Ubuntu 18.04.1 LTS with Wayland. I tested with gimp also in a Dell Latitude E7240 with 8 GiB RAM and 18.04.1 LTS persistent live with Xorg.



The total RAM usage including operating system is measured with free -m.




  • gimp - works best for me also at full resolution (without delay), 6143 MiB RAM. It works well both with 16 GiB RAM and 8 GiB RAM.


  • shotwell - works also at full resolution (without delay), 7920 MiB RAM (after some horizontal and vertical scrolling at full resolution)


  • gpicview - works but slower (failed to show full resolution directly, but works when gradually zooming in to full resolution, total RAM usage when showing and zooming 3016 MiB RAM, but 4219 MiB RAM during loading.


  • feh - does not work 'No ImLib2 loader for that file format'



  • eog - does not work 'too big image'


  • ristretto - does not work (silently, shows a thumbnail, but no picture)


Conclusion



It should work with Ubuntu and 8 GiB RAM to view this picture with several viewers, and the editor gimp works really well for me. With 6 GiB RAM, you should select a light-weight viewer, and with 4 GiB probably be prepared to wait for some swapping.



Please notice that I have measured the total usage of RAM (including the operating system).



Final comment



This is a great picture well worth zooming into with the tools, that you have available. I should add that the zoom tool of the web site works well with Firefox for me in a computer with 4 GB RAM, I could reach a zoom level corresponding to full resolution of the 1.7 GB Tiff file and I could scroll horizontally and vertically to see the whole picture.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 25 at 18:48

























answered Jan 25 at 18:01









sudodussudodus

24.2k32875




24.2k32875













  • I'm impressed that you took the time to download a 1.7GB picture

    – Charles Green
    Jan 25 at 19:00











  • @CharlesGreen, Well, with ~10 MB/s it is only 1700/10 seconds ~ 3 minutes (not too long). And it is a great picture :-)

    – sudodus
    Jan 25 at 19:11













  • I'm at the end of a not-very-fast DLS link - they say 10 Mb/s so...24 minutes? But firefox says ~ 3 hours....

    – Charles Green
    Jan 25 at 19:13











  • @CharlesGreen, I was lucky, the website was not busy, so it could send at high speed. I hope your speed will increase within a few minutes.

    – sudodus
    Jan 25 at 19:17



















  • I'm impressed that you took the time to download a 1.7GB picture

    – Charles Green
    Jan 25 at 19:00











  • @CharlesGreen, Well, with ~10 MB/s it is only 1700/10 seconds ~ 3 minutes (not too long). And it is a great picture :-)

    – sudodus
    Jan 25 at 19:11













  • I'm at the end of a not-very-fast DLS link - they say 10 Mb/s so...24 minutes? But firefox says ~ 3 hours....

    – Charles Green
    Jan 25 at 19:13











  • @CharlesGreen, I was lucky, the website was not busy, so it could send at high speed. I hope your speed will increase within a few minutes.

    – sudodus
    Jan 25 at 19:17

















I'm impressed that you took the time to download a 1.7GB picture

– Charles Green
Jan 25 at 19:00





I'm impressed that you took the time to download a 1.7GB picture

– Charles Green
Jan 25 at 19:00













@CharlesGreen, Well, with ~10 MB/s it is only 1700/10 seconds ~ 3 minutes (not too long). And it is a great picture :-)

– sudodus
Jan 25 at 19:11







@CharlesGreen, Well, with ~10 MB/s it is only 1700/10 seconds ~ 3 minutes (not too long). And it is a great picture :-)

– sudodus
Jan 25 at 19:11















I'm at the end of a not-very-fast DLS link - they say 10 Mb/s so...24 minutes? But firefox says ~ 3 hours....

– Charles Green
Jan 25 at 19:13





I'm at the end of a not-very-fast DLS link - they say 10 Mb/s so...24 minutes? But firefox says ~ 3 hours....

– Charles Green
Jan 25 at 19:13













@CharlesGreen, I was lucky, the website was not busy, so it could send at high speed. I hope your speed will increase within a few minutes.

– sudodus
Jan 25 at 19:17





@CharlesGreen, I was lucky, the website was not busy, so it could send at high speed. I hope your speed will increase within a few minutes.

– sudodus
Jan 25 at 19:17


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112641%2fhow-to-view-extremely-large-images%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕