Steve's Digicams Forums

Steve's Digicams Forums (https://forums.steves-digicams.com/)
-   General Discussion (https://forums.steves-digicams.com/general-discussion-11/)
-   -   To understand compressed picture (https://forums.steves-digicams.com/general-discussion-11/understand-compressed-picture-6878/)

maximebeauvais Feb 6, 2003 6:49 AM

To understand compressed picture
 
like I said, my friend gave me an example of compressed picture:

1) open paint (or any other editor) draw a black line.
2) save has test.bmp and save the same line as test2.jpg
3) open the test2.jpg and save it has test3.bmp

4) now open test.bmp, test2.jpg and test3.bmp
5) do a zoom and see the result.

NOW I undertand the principal of compressed image.

If you want a big and clear image use the best setting in your cam. In my case, the TIFF are 100% good.

THANKS TO MY FRIEND!!!!!

BillDrew Feb 6, 2003 9:14 AM

You have part of it. TIFFs from a digicam are not perfectly clean, even neglecting issues like lens resolving power and shake.

Your camera does not have a sensors that measure the RGB value at each pixel location - there are paterns of sensors with filters so each one measures only the Red or the Green or the Blue at its location. These are then blended/manipulated/hammered/mashed/... into an estimated RGB value for each pixel. So each pixel out of your camera even in TIFF is a blend of several pixels. That is analogous, but not the same as, the kind of thing that goes on with JPEG compression. It is possible that the blending used to produce TIFFs has enough "blurriness" that there is no further loss by using low compression JPEGs. This will depend on how the specific camera deals with producing the TIFF and how good a job that camera does with low compression JPEGs. I doubt there is a valid universal rule about how TIFFs and JPEGs out of a camera compare.

Do some reading on RAW format output to get some understanding of this issue.

Your friend has the right idea - do your own experiments whenever possible. Shoot some TIFFs and JPEGs with your camera and look for differences.

voxmagna Feb 6, 2003 10:28 AM

Quote:

2) save has test.bmp and save the same line as test2.jpg
The next part of the experiment is to repeat with a test image that has lots of detail and colour, then select different compression factors on the save.

This will help you appreciate why cams offer a choice of compression factor/filesize options - small file is not always best! BUT we have a choice and doing your experiments, you learn what's practical for your card, printsize, and cam processing speed.

I agree that sometimes cam TIFF outputs don't look like discrete square pixel sites you might see with a scanned image, but my cam has octagonal pixels with averaging from adjacent pixel sites, so I can't believe anything that looks square!

NHL Feb 6, 2003 12:42 PM

Maxime

There's a flaw here:
Quote:

my friend gave me an example of compressed picture:

1) open paint (or any other editor) draw a black line.
2) save has test.bmp and save the same line as test2.jpg
3) open the test2.jpg and save it has test3.bmp

4) now open test.bmp, test2.jpg and test3.bmp
5) do a zoom and see the result.
You're comparing a 2nd generation jpeg against the original.


It should have been this way from the camera:
1) open paint (or any other editor) draw a black line.
2) save as test.tif and save the same line as test.jpg
3) now open test.tif, test.jpg
4) do a zoom and see the results
5) open Window Explorer and check the .tif and .jpg file size

Do you see a difference (this test is too simple, mutiple criss-crossing lines in different color would have been better)?
The jpeg's file size will be smaller depending on the compression level used when saved(ie more pictures), and also allow you to run your camera faster as well as saving the battery! ie it's perfectly fine to shoot in jpeg and save the original (ie 1st generation). If all you have is tiff then there's nothing you can do about, but for people that have the option, raw is better and more efficient out of the two!

koruvs Feb 6, 2003 1:48 PM

My 5700 does JPEG, TIFF and RAW. Currently I have a 256MB card (looking at getting a larger card soon 512 - 1GB)

I set the resolution to 2560x1920 and a 256MB card would give me the following:

108 in JPEG
19 in TIFF
32 in RAW

According to the camera picture details/quality the numbers above would change a bit +/-. From my own shots lately the average size is 1.8MB per JPEG file at 2560x1920. taking that into account I'd get about 142 pics instead of the guesstimate the camera gives you. RAW pics are guesstimated at 32 by the camera and could acutally get me 40ish pics. I'll test that today :)

I suppose RAW would be OK for very specific shoots like portriats and commercial work. For weddings, day trips, vacations and family events I'd use JPEG for the majority of the pics. If I used RAW all the time it could make me miss a shot because of the write times and I'd have to get large cards to equal the space taken up. 2x 1GB cards would be more than my camera. lol

NHL Feb 6, 2003 2:23 PM

Most of the time jpegs is all anyone need (ie can you tell the difference between tiff/jpeg?), is it worth the extra time, the extra memory space, and the power consumption?

Quote:

108 in JPEG
19 in TIFF
32 in RAW
That's the whole point... If you have to keep the best output from a camera raw is the better one (rather than tiff) beside it's a true 12-bit resolution to boot :lol: :lol: :lol:


Quote:

1. The raw file is much smaller than tiff
2. raw has all the picture info (no more no less)
3. This was discussed before, raw is still 12-bit colour (tiff is 8-bit from the camera).
4. If you messed up, there's still a slight chance to recover in raw back on the PC (not so with tiff)
Beside when saving raw with Photoshop one has the option to convert it back to tiff (@ 16-bit, ie 48-bit colour)!

voxmagna Feb 6, 2003 4:13 PM

We must remember that shooting several pics in JPEG quickly can get that special pic. whereas the slower capture for bigger files and changing media cards, might mean we don't get a decent pic at all!!

Often we forget that photography is about capturing 'moments' and not always about Mpixels (although they help).

I'd keep the higher file formats for the pics you have time to compose and know they will be printed big, until all cams will shoot RAW/TIFF on mega media, just as quick as they do with JPEGS at the mo.

eric s Feb 6, 2003 4:44 PM

koruvs

If you can deal with a 512MB card, they've dropped in price down to about US$200 (I saw US$150 on sale) for the Sandisk Ultra (20x? 24x? either way, quite fast.) That sounds like a decent option to allow double the number of pictures and makes that RAW mode more tempting.


And, as NHL like to say, MicroDrives are cheaper than CF of the same size.... So that would be a way to get you up to 1G of space <all the usual MicroDrive warnings go here>.
Eric

koruvs Feb 6, 2003 5:50 PM

Well, interesting results in RAW format, all pics were exactly 7.65MB at 2560x1920 resolution.

So a 256MB card gets you 33 pics in RAW. All pictures were of different details, colors, etc. so I was surprised that all the files were the same size. Unlike JPEG were the more color/details the larger the size. I have seen JPEG range anywhere from 1.5 to 3.0MB at 2560x1704.

EricS,

I was looking at the SanDisK Ultra 512MB, since I am pleased with the current 256MB version of the same. The 512MB version is about $500 Canadian. If I get a wedding shoot I'll have no choice but to get one...or 2 ;)

BillDrew Feb 6, 2003 7:07 PM

Quote:

Originally Posted by koruvs
Well, interesting results in RAW format, all pics were exactly 7.65MB at 2560x1920 resolution. ....

That is interesting - there isn't any compression at all. Each pixel in raw is a twelve bit number, or 1.5 bytes. Add ~280K for EXIF (sort of) data and that comes to 7.65M.

Would be interesting to know what compression factor you would get by ZIPing them. That likely would change with the amount of detail in the picture.

koruvs Feb 6, 2003 7:37 PM

Hi BillDrew,

I have never really used RAW format before and when I did I didn't pay attention to the files sizes so I was some what surprised to see the file sizes being the same. Coming from a JPG world only it made me curious. Thanks for the brief explanation though, it cleared things up for me :)

NHL Feb 6, 2003 9:09 PM

Koruvs

Didn't we just went through this already for using raw files to measure flash speed and not jpegs? http://www.stevesforums.com/phpBB2/v...ghlight=#29457

IMO zipping wouldn't make a difference, since one has to unzip them first back to the original format before the program (ie NikonView or a Photoshop plug-in) can decode them... Some pro dSLRs do compress their raw file , but at the expense of a longer extra step for a smaller file size... either way the original raw data monochrome reading from the CCD has to be decompressed again or preserved to complete the interpolation to a full color pixel. For example adjacent pixels are usually not in-line when data is shifted out from the CCD, but are on the N-1, and the N+1 line, and the consecutive pixels are usually of a different color R, G, or B making any compression not very effective...

koruvs Feb 6, 2003 9:39 PM

NHL, oh, way back then...I was young and unexperienced compared to now :lol: :shock: :lol:

voxmagna Feb 7, 2003 3:39 AM

Quote:

Would be interesting to know what compression factor you would get by ZIPing them. That likely would change with the amount of detail in the picture.
Just a comment: Winzip is a compression algorithm looking for regular pattern and redundancy in data. Photos contain a lot of random data so that's why we use JPEG/MPEG.

NHL Feb 7, 2003 5:40 AM

FYI everyone

An another example why the above test is flawed:
Quote:

Plain black-and-white (two level) images should never be converted to JPEG; they violate all of the conditions given above. You need at least about 16 gray levels before JPEG is useful for gray-scale images. It should also be noted that GIF is lossless for gray-scale images of up to 256 levels, while JPEG is not.
http://www.faqs.org/faqs/jpeg-faq/part1/


Vox

I believe that's what Bill was talking about ie zip the raw file for smaller size before transfering then unzip back to the original format before using on the PC. Jpeg raw was never an option since this compression is performed on blocks of pixels eight on a side!

BillDrew Feb 7, 2003 8:46 AM

My comment about ZIPing the RAW files was purely a matter of curiousity - not sure that it would be worthwhile. With a photo that was purely single valued , there would be a regular patern of byte values. Would ZIP pick up the compression possibility in a patern of similar valued bytes in regions like a flat sky? As NHL pointed out, the patern would not be simple, but there would be a patern Likely he is right about not getting much compression from ZIP, but I am a strong believer in experimenting.


All times are GMT -5. The time now is 2:03 AM.