Start a conversation

Tips for Printing Large Raster Images

Issue

When printing raster images with MicroSurvey CAD, occasionally the image will not appear in the final copy, whether it is to a physical printer/plotter a to a PDF file.  This tends to happen most commonly when very large raster images (such as aerial photos) are inserted in a drawing, and when it is then plotted to a large paper size such as ARCH D, while printing to a Letter size page may work fine.

Below are a few things you can do to help plot with the image, but first I want to describe in detail why this occurs so you can understand the problem.

 

Cause

You have attached an image to your drawing file - it looks fine in the drawing, shows up fine in the print preview, and you know the image isn't corrupt or anything because you can open it and maybe even print it from other programs.  But sometimes it won't print from MicroSurvey CAD.  Why?

This really boils down to a memory problem, with the system becoming completely overwhelmed with the vast amount of data sometimes being used to descibe what to put on that piece of paper or PDF file.  To understand how much data is there, you need to look at more than just the filesize of your image file.

Because of various image compression technologies, you can't necessarily rely on filesize to tell you how much image data there is. To really determine how much data an image contains, use Windows Explorer to browse to the folder where the image is, right-click on the file, and select Properties.  Then go to the Summary tab and press the Advanced button.  There's a lot of information here, but the we are only interested in the Width, Height, and Bit Depth.  For example:

Width=10,000 pixels

Height=10,000 pixels

Bit Depth=24

Multiply the Width * Height to get the total number of pixels in the image.

Width * Height = 10,000 pixels * 10,000 pixels = 100,000,000 pixels

Divide the Bit Depth by 8 to get the number of Bytes of data for each pixel in the image.

Bit Depth / 8 = 24 bits per pixel / 8 bits per byte= 3 bytes per pixel

Multiple the total number of pixels in the image by the number of bytes per pixel.

100,000,000 pixels * 3 bytes per pixel = 300,000,000 bytes = 296 MB

(300,000,000 bytes / 1024 bytes per kilobyte / 1024 megabytes per kilobyte = 296 megabytes)

The filesize of the image may be this big, or it may be much smaller just depending on compression factors. For example a JPG file is always much smaller than a BMP file with the same number of pixels and colors, because the pixel data is written to disk more efficiently.  For this reason, you cannot simply rely on the filesize to determine how much data is in a raster image file.

As a similar exercise, you can calculate that a 15,000 pixel by 15,000 pixel image with a 24 bit color depth, works out to contain 643 MB of image data.

That is how much memory is required to hold the entire image.  MicroSurvey CAD employs disk cacheing so that all of this image data does not have to be held in memory at one time; it dynamically loads and unloads parts of the image from your harddrive into your memory based on what part of the image is being viewed, and how far in or out you are zoomed.  This is why when you pan over a large image you may experience moments when the program seems to stick for a moment, it is actually getting to the edge of the data that it has loaded in memory, and has to load up some more from your harddrive (and loading data from a harddrive is always much slower than loading data from memory).  Only when you initially open a drawing containing a raster, does the entire image get temporarily loaded into memory - it has to do this to setup the disk cacheing, it then releases most of this memory and reloads what it needs from the disk cache when necessary.  (You can see this happen if you watch the icad.exe process in your Task Manager.)

When printing your image, it essentially does the same operation again but in reverse.  This time you have to consider the final paper size and resolution, rather than the raster image's pixel size.  For example, consider printing to an ARCH D paper size.  When I print using Adobe PDF, it defaults to 1200 DPI which is a pretty high quality.

Width = 24 inches * 1200 Dots Per Inch = 28,800 dots or pixels

Height = 36 inches * 1200 Dots Per Inch = 43,200 dots or pixels

Multiply the Width * Height to get the total number of pixels to be printed:

Width * Height = 28,800 pixels * 43,200 pixels = 1,244,160,000 pixels

Determine your Bit Depth and divide it by 8 to get the number of Bytes of data for each pixel to be printed:

You Printer Driver determines the bit depth being used, but it is typical for modern printers to support True Color which is 24-bit color depth.  (Note, selecting the Monochrome.ctb print style instead of Icad.ctb does not affect this - doing so only means that the printer will only plot using 1 out of the approximately sixteen million potential colors, but it still has to account for the possibility of all of these other colors.  If you can switch between Color and Black&White printing directly inside your printer driver, this may reduce the final color depth from 24-bit to 1-bit (or 0.125 bytes per pixel instead of 3 bytes per pixel.)

Most modern printers typically support True Color or 24-bit color depth.  (3 bytes per pixel)

Multiple the total number of pixels to be printed by the number of bytes per pixel.

1,244,160,000 pixels * 3 bytes per pixel = 3,732,480,000 bytes = 3559 MB = 3.47 GB

(3,732,480,000 bytes / 1024 bytes per kilobyte / 1024 kilobytes per megabytes / 1024 megabytes per gigabyte = 3.47 gigabytes)

As you can see printing at high resolution requires much more memory than simply displaying the image on screen.  This is why you can often attach an image and see it displayed in MicroSurvey CAD with your drawing no problem, but when printed you only get the linework and not the raster image.

Luckily, there are several different things you can do to reduce the memory required when displaying and/or printing raster images.

 

Solutions

This is a pretty complex issue, with a lot of underlying factors.  As such, there isn't one single specific thing I can tell you to do that will always work.  Instead, you may need to apply a combination of the following tweaks:

1) Reduce the Print Resolution (DPI)

As an example, conside an ARCH D page size which measures 24"x36".  Some plot drivers, especially PDF Virtual Printers, have a default high-resolution output of 1200DPI (Dots Per Inch).  That's a lot of dots, which can be a problem especially since once you start coloring the dots you can easily end up with over a gigabyte of data describing one 24"x36" piece of paper.

Consider the example calculated above, printing an ARCH D sheet at 1200 DPI results in 1,244,160,000 dots, or 3.47 Gigabytes of data describing one sheet of paper.

Other plotters may default to 600 DPI.  In this case, your 24x36 page consists of 14,400 x 21,600 dots, or a total of 311,040,000 dots.  That's still a lot of dots, and once they are colored this can still end up being over a gigabyte of data.

For comparison, if you can reduce the resolution to a lower-quality setting such as 72DPI you have reduced your page to 1,728 x 2,592 or 4,478,976 total dots.  That's down from over 1.2-billion dots at 1200DPI or over 300-million dots at 600DPI, to less than 5-million dots at 72 DPI!

Of course using other intermediate resolutions such as 150DPI or 300DPI will give you similar appropriate reductions.  Experiment with it - if 72DPI is not sharp enough, then boost the resolution higher, and use a combination of other tips described in this article to make the image appear.

2) Crop or Clip the Image

This is a more basic concept - the amount of image data used to describe the raster is reduced, because there is obviously less raster image there to describe.

Two methods, both of which seem to have the same end result when printing:

a) Crop Image File

This reduces the number of pixels in the actual image file.  For example if you have an aerial photo of a farm, you can crop it down to only the farmhouse and leave out thousands of acres of cropland.  The cropland is gone, kaput - don't overwrite your original image file!  You may only need 1000x1000 pixels out of an entire 15,000x15,000 pixel file - that's only 1/225th or 0.4% of the image data!

This can be done with graphic editing programs like Adobe PhotoShop, or many many other programs.  Personally, I use a freeware application called IrfanView which has always worked quite well for my basic requirements like converting file formats and doing minor edits - I am by no stretch a graphic artist, and this little freebie is all i've ever needed.

It is important to note that doing this will cause any georeferencing World files for your image to not work correctly, because they rely on the image size (number of pixels) to remain constant.

It is both easier and safer to...

b) Clip Displayed Image

This is a command in MicroSurvey CAD (go to View | Raster Images | Clip Image, or type IMAGECLIP) which reduces how much of the image is actually displayed.  Using the previous farm example, the image can be clipped so that the cropland is no longer displayed, but it is still there and you can get it back or change the clipped area with ease.  You get the same memory savings, without destroying the original file or its ability to use an existing world file.  You can also just run the ImageClip command again if you need to change the clipped area again to display more or less of the original image - instead of having to go back and re-crop another copy from the original file, re-insert it, and re-align it with your linework.

3) Reduce the Color Depth of the Print

Because this depends on how the printer driver was programmed by the manufacturer, this may or may not help.  The theory is that printing in Black&White should use a 1-bit color depth, compared to printing in Color using perhaps a 24-bit color depth.  Whether the driver still allows enough memory space for all of these colors when only using 1 color, or if it reduces the memory required to support the limited color palette, all depends on how the printer manufacturer programmed their drivers.

Note, selecting the Monochrome.ctb print style does NOT make this happen, because the printer driver is still anticipating that more colors can be sent to the printer - you need to use the Print Setup button and access the Properties of your printer to look for and change a color option, if one exists. 

As described above, printing in True Color means it can print over 16-million colors, so it sets aside 3 byts of data per pixel that it draws on the paper.  True Black&White is only 1-color, so it only needs 0.125 bytes of data per pixel.  That is a huge memory savings for the printer driver!

4) Reduce the Color Depth of the Image File

This reduces the amount of memory required for each pixel in your image file, by reducing the total number of colors to describe.

Most image files are 32-bit, 24-bit, 16-bit, or 8-bit color.  Lower color depths are possible, but the color palette becomes so limited that the image can become very muddy and unclear because of the lack of shading.  Please refer to the following chart to see how reducing the color depth can dramatically affect the memory required to describe an image.  Note, this same data also affects greyscale images (what many people think are monochrome images), just that each "color" describes a different shade of grey.  (True "monochrome" has no shades, just black or white; this is 1-bit color depth.)

Color Depth Total Number of Colors

Memory Required (per pixel)

Memory Required (per 10,000x10,000 pixel image)

32-bit 16,777,216 + Alpha Data 4 Bytes 400,000,000 Bytes (approx 381 MB)
24-bit 16,777,216 3 Bytes 300,000,000 Bytes (approx 286 MB)
16-bit 65,536 2 Byts 200,000,000 Bytes (approx 190 MB)
8-bit 256 1 Byte 100,000,000 Bytes (approx 95 MB)

Reducing the color depth of an image requires a graphics editor, such as Adobe PhotoShop or IrfanView.  Like cropping, make sure you do not overwrite the original image with the reduced color image, because once it's gone, it's gone. 

It is usually unnecessary to require more that 16-bit color for high-quality color images - greyscale images or low-resolution aerial photos are often quite fine at 8-bit.  Experiment with it, what works well for one image may not be appropriate for other images.

 

Conclusion

Because of the complexity of this issue and the number of underlying factors that affect how an image gets from your harddrive, into the MicroSurvey CAD, then into your plotter driver, and finally out to your plotter or PDF file - there are many potential ways of improving performance.  You may need to combine more than one of the above solutions, and you may find that what works for printing one large image may not work for printing all large images.  Changing the printed DPI and Color Depth through your printer driver is easy, if possible these are the first two steps that should be attempted.  Clipping the image within MicroSurvey CAD reduces the memory required, without affecting your actual image file, so the clipped area can easily be changed as needed.  Cropping the image and/or reducing the color depth of the image both permanently change the image file, so be sure to Save As to a new image file, or make a backup of the original image file so that you don't lose the original image.

If you run across any other methods of improving the printability of your raster images, please let us know using the "Add a Comment" link at the bottom of this page.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Brian Sloman

  2. Posted
  3. Updated

Comments