Recompress your digital pictures to save space

I have 23,000 digital pictures and movies taking many gigabytes of storage from the past decade or so. The more recent ones are larger, because higher resolution cameras were more readily available. I have a few copies of the entire collection on various computers for backup. I would like to save some space, perhaps to get more disk space to copy a Virtual PC image onto my machine for a conference. I can recompress these pictures to take less space. (I won’t change the master copy.) I display the pictures on the screen much more often than I print them. In fact, all of the pictures get displayed via my screen saver. Of course, multi-megapixel cameras are much higher resolution than they need to be for display on a screen. See this link for a chart of camera resolution vs photo print size.

I believe some digital cameras have the ability to recompress pictures already stored: if you run out of space while on vacation, you can choose an option on the camera to recompress (perhaps changing resolution) to get more space. Has anybody seen this feature?

(Another way to get more space: my picture query program will automatically substitute the VFP generated thumbnail for display if the full size picture isn’t found, so I can delete a year’s worth of photos and still see the photos as enlarged thumbs)

I used my treemap program to get the full breakdown of space being taken by the pictures. Recompressing 2004 will get the most space.

Run the program below to recompress a JPG and show it (by default) with Windows Picture and Fax Viewer. Zoom in on the original and resampled files: you can see the deterioration in quality when you zoom on the resampled picture.

The result for that picture is indistinguishable unless I zoom in, and the file size went from 1600 K to 245K, or about 6.5 times smaller! That’s about %85 space saved.

Images that have a lot of detail (like a complex pattern on wallpaper) don’t compress as well as simpler images (like a blank wall), so your mileage will vary.

cPict=GETFILE("jpg","JPG please","",0,"Choose a picture to recompress")

cOutfile="d:\t.jpg"

LOCAL oImage as gpImage OF (HOME()+"ffc\_gdiplus")

oImage=NEWOBJECT("gpImage",HOME()+"ffc\_gdiplus","",cpict)

oImage.SaveToFile(cOutfile,"image/jpeg","Quality=20")

ADIR(aa,cOutfile)

nSizeNew=aa[1,2]

ADIR(aa,cPict)

nSizeOrig=aa[1,2]

?"Orig Size = ",TRANSFORM(nSizeOrig,"999,999,999")

?"New Size = ",TRANSFORM(nSizeNew,"999,999,999")

?"# bytes smaller = ", TRANSFORM(nSizeOrig - nSizeNew,"999,999,999")

?"# times smaller", nSizeOrig / nSizeNew

?"% savings=", 100*(nSizeOrig - nSizeNew)/nSizeOrig

! &cOutfile