Showing results for 
Search instead for 
Did you mean: 

How to Resize a picture

I am using web cam acquiring image using lab view. i want to reduce the size of the picture before saving it .currently the size of the iamge is 300*200. i want to save it in smaller size becaz iwill be displaying this image on mobile and that require small pictures.any idea how to do it in labview.
0 Kudos
Message 1 of 30

Attached is a VI which resizes a 2D array (7.0) . It was designed to resize pictures and for pictures of your size it should be fast enough. I don't think webcams use 24 bit color, so you may have to make some modifications. Also, it doesn't do any "clever" stuff like averaging color values. It just takes some of the elements from the original, which seems to be good enough.

From what I saw, this VI gets slow when handling large arrays (I saw about a second for a 2800x1500). Does anyone have any optimizations ideas? I know that when windows creates thumbnails it also takes time, so I'm not too optimistic.

Message Edited by tst on 07-27-2005 12:14 PM

Try to take over the world!
Message 2 of 30

Try this link for the quicktime library. It has an imagetransformation vi in it. You can scale the X and Y independent of each other. You need quicktime installed.

0 Kudos
Message 3 of 30
Here's an addition - a VI which loads a directory of JPGs, resizes them and displays them in a 2D array.

Try to take over the world!
Message 4 of 30

VERY nice vi. 10 stars least

Thanks tst...

0 Kudos
Message 5 of 30
Thank you very much for these most useful vi's
They resize the jpeg's quickly, and present them in a handy 2D array.
Thanks again for sharing your work.
0 Kudos
Message 6 of 30

For the ones who came here by search, here is an example that resizes very fast and easy.

Some applications don't need more than this.


The VI also converts it to excel, after col & row resize the picture appears.

Maybe by choozing better characters results become even better. 



Message 7 of 30

That's nice - faster and considerably simpler than my version.


A few points for improvement:


1. The resizing is the same both ways. You could just change it to a be ratio of the current size.

2. You can easily set a different ratio for X and Y.

3. You probably want to convert the value to an integer as early as possible to avoid having repeated coercions inside the loop.

Try to take over the world!
0 Kudos
Message 8 of 30

First, i know its an old thread 🙂


2nd: how can you take RalcoBe resize function and also adjust the image MASK. I want to resize a png and keep the transparency.

- A minute saved is a Minute earned!
0 Kudos
Message 9 of 30

Hi profit,


replace the JPGFileLoad by PNGFileLoad. Then rescale the picture data the same way - but do the same for the mask data delivered by PNGFileLoad. Then recombine both scaled arrays into a new image data cluster...

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 30