Reducing image file sizes

Brian Yennie briany at qldlearning.com
Mon May 18 22:39:41 EDT 2009


This is just off-the-cusp, so it may be off, but what about:

1) Set the fileName of image 1 to the JPG
2) Copy the imageData of image 1 into image 2
3) Export from image 2 as JPEG
4) Scale the final image to the desired size (if necessary)

The reason why I'm hoping this would work -- imageData is at screen  
resolution (72 DPI) so this could be a shortcut to getting 72 DPI  
images if you export from images with only imageData (and no backing  
file).

Of course if 72 DPI is too low quality... maybe it would work to scale  
to double size first, and end up with 144 DPI?

Totally, utterly untested but hopefully helpful =)

You said that you need to find the original size -- does Rev not open  
high resolution images at the correct size?

> Brian Yennie wrote:
>> If you're up for the programming headaches involved, one way to  
>> deal with very large images is to cut them up into tiles. For  
>> example, cutting each image into 4 tiles can saving them in JPEG  
>> format can be considerably smaller than the original image. I  
>> believe the effectiveness would depend on your content, and of  
>> course will only work in a compressed format like JPEG where each  
>> tile has a chance to be optimized by the compression algorithm  
>> separately. You could potentially load the tiles into a group of  
>> image objects and then manipulate the whole group at once.
>> If this is going on a CD, can you not literally use Graphic  
>> Converter? I believe it is scriptable. If you cut the resolution in  
>> half (which will double the dimensions), THEN scale to 50% you  
>> should end up with the original image size with half the resolution.
>> One last thought, you could attempt to use imageData -- skip every  
>> other pixel to get "half" resolution and see how the quality turns  
>> out.
>
> ImageData was my first thought, or exporting snapshots. Maybe if I  
> explain more what this is for it will inspire some ideas.
>
> This is for an inventory database and many of the records have  
> multiple (referenced) images. The inventory data is used for  
> insurance purposes. The customer base is largely computer-naive,  
> almost all using Windows XP or Vista, with a smattering of OS X users.
>
> The software works fine, it's the customers that are the problem. :)  
> They are taking digital photos that weigh in at 3-4 megs apiece, and  
> scanning documents even larger, and creating hundreds of images. My  
> client gets complaints that the software prints too slowly, and that  
> all the data won't fit on a CD.
>
> So we decided to reduce their images for them behind their backs.  
> The goal is to make the files as small as possible while retaining  
> good enough quality to use for insurance claims. Marriage licenses  
> and other documents have to remain legible. But of course we don't  
> know ahead of time what resolution the images are at. I only know  
> they are all jpegs.
>
> Cutting up images would be difficult to work with in a program like  
> this, and I can't use a third-party program to do the processing  
> because there's no way to know what the customers have installed. So  
> what I need to do (I think) is determine what that original size is,  
> scale the image to be that size, and then save the imageData from  
> that. Or so the theory goes.
>
> I've been doing some googling and the specs for JPEGs say the  
> resolution info is saved in the file header. If I knew the  
> resolution I could calculate the original image size. I opened a few  
> jpgs as text and looked at the headers but I couldn't find it in any  
> of them. If it's in there, it isn't readable to me.
>
> Maybe I should just suggest we change the program specs...unless  
> someone has ideas?
>
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

---
Brian Yennie
QLD Learning
(310)-367-7364





More information about the use-livecode mailing list