Showing results for 
Search instead for 
Did you mean: 

Lab windows Picture Control causing huge apllication size

Go to solution

I have used a picture control in my Labwindows uir. An image of size 4MB (jpg) is loaded into the control. This is causing the application size of 64 MB instead of 3MB with a bmp file of 1MB . What is the cause for this and how to reduce the application size?

0 Kudos
Message 1 of 3
Accepted by topic author monikarjain

.JPG and .PNG are compressed image formats: internal algorithms make file on disk footprint more or less huge depending on image characteristics and the efficiency of compression. .BMP files on the contrary are not compressed. When you load an .JPG or .PNG image into a CVI picture control all that compression is lost and the image in memory gets its true size (and so does the .UIR file).


What you may do is to choose a different image or manipulate the image to reduce its internal size Just as an example you may rescale the image to picture control dimensions if larger.

Consider that a picture of mine which is 2300*3400 pixels is stored in a 2.3MB .JPG file, but if saved as a 24-bit bitmap results in a 32 MB file! If reduced to 25%in each direction dimensions become 234 kB and 1.3MB respectively.


A significative memory saving may be obtained by reducing the color depth, for example using a 256-color image if possible.


The alternative of loading the picture at runtime only reduces the UIR file size: it has no effect on memory footprint once the image is loaded which depends on image characteristics.

Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
If I have helped you, why not giving me a kudos?
Message 2 of 3

Thanks a Lot. By changing image resolution to picture control size has reduced the size of jpg file and in turn size of uir and application file.

0 Kudos
Message 3 of 3