Resolution for QN #200159996 - Lockout Pro 3.0.1 Printing or Display Graphic as a Black Box

This issue where the user is seeing black boxes either on the screen or on the printout has come up a couple times

The Issue:

A common misconception seems to be that the file size is how much RAM the image will use in memory. This is not the case. Different image formats (jpeg, gif, tiff, png, etc...) are used for various reasons based on factors such as network bandwidth, the amount of storage the user has, and the image quality the user desires. When a user brings a graphic into LOP, we use a third party tool to convert and store all images as bitmaps. We do this for the following reasons:

1. So they can be drawn to the screen or sent to the printer.

2. Bitmaps do not loose quality

3. Bitmap is an open format.

With that said, bitmaps take up more space on disk and in memory than other formats. Also, when we are displaying or printing a bitmap, it has to have a contiguous chunk of memory (this is controlled by Windows to optimize bitmap processing). When you have procedures with multiple graphics and each graphic needs 11-20 MB of contiguous memory, the memory becomes fragmented and the operating system denies our request for the large chunks of memory and that is when we display a black box.

Common Cause:

Images taken from digital cameras are generally way bigger than we need them to be. For instance, a 1.3 Megapixel camera takes a picture at 1280 x 1024. My display is set at 1152 x 864 so when I open that image in Jasc Paint Shop Pro at 100% zoom, the whole image doesn’t fit on my 20” monitor and in LOP the largest an image can be is about 4” high and about 8” wide. An image taken on a 1.3 Megapixel camera at a resolution of 1280 x 1024 needs about 3.8 MB of RAM. It seems the users who are having issues are using images taken on a 3.8 Megapixel camera which need about 11 MB of RAM and images taken on a 6.1 Megapixel camera which need about 17.2 MB of RAM.

Fix the Issue:

1.  Prevention is the best solution right now. Most digital cameras allow you to change the resolution you are shooting at. I would start at the lowest resolution, take a few pictures, put them in LOP and if the image quality is not acceptable, bump the resolution up a level and repeat the process until you find an image resolution that is acceptable.

2.  Edit the images in an image editing program. An application like Jasc Paint Shop Pro or Adobe Photoshop allow you to resize an image which is what I have been doing for the procedures Brad/Bruce had sent me earlier.

3.  In LOP 3.0.1 we added some extra memory management logic, but we could do more. We could also add in functionality in LOP on our image editing screen to resize a graphic along with showing the bitmap size as Jasc Paint Shop Pro does (shown in Method 2 below).

Below are 3 different ways Tech Support or the user can use to determine how much RAM an image will use as a bitmap in LOP. They are meant as an educational tool to understand how all the numbers above were calculated.

How to determine memory usage:

Method 1: Straight calculation

Calculation:

Width (in pixels) * Height (in pixels) * Color Quality (32 bit=3 bytes)

For an image 2272 by 1704 with 32 bit color display:

2272 * 1704 * 3 bytes = 11,614,464 bytes = 11.0 MB (32 bit)

Note: See graphics below which show how to determine the image size in pixels and the color quality.

Image size in pixels: Color Quality:

Method 2: Use Image processing application

Image processing applications such as Jasc Paint Shop Pro will show you how much memory is needed to display the image. The screenshot below shows that the image is 2272 by 1704 and it is using 16 Million colors (which is the same as 32-bit color quality) and it takes up 11 MB of RAM (same result as the calculation in Method 1)

Method 3: Save Images as bitmaps

You can also use an application such as Paint and save the image as a 24-bit color bitmap (this is the same as 32-bit quality…in 32-bit quality bitmaps, only 24 bits are used for RGB…the other 8 bits are generally empty…32-bit bitmaps, which are 24 bits of color and 8 bits of empty space are generally used because of optimizations that can be made at the processor level for 32-bit processor machines). Once you save the bitmap open the file properties and you will see the file size matches the numbers shown in the two methods above.

Bitmap file size: