General Question

waterskier2007's avatar

What is the difference between a lossy and a lossless file extension?

Asked by waterskier2007 (2068points) June 6th, 2008

i was browsing filext and noticed in a description that .jpg is a lossy format whereas .bmp isnt. what is the difference

Observing members: 0 Composing members: 0

10 Answers

playthebanjo's avatar

In a general sense, the lossy will loose something each time you save it wheras the lossless will not. This might clear it up

ccatron's avatar

this guy explains it pretty well.

This is helpful as well.

XCNuse's avatar

one losses information… other doesnt.

jpeg files use some compression (one which I don’t understand), while a bitmap holds all the information of the image in a matrix setup, giving each pixel a specific R, G, and B value, which is why they are typically such large file types.

Other lossless formats like (well, not everyone will agree that this is a lossless, but it’s pretty darn close), png, I don’t understand compression so I can’t explain that to you.

tvilot's avatar

Basically, JPEG uses a compression technology whereby some data is “thrown away” and replaced with sufficient data that the human eye won’t be able to distinguish the difference. So, for example, if the photo contains a lot of blue sky, instead of saving every single pixel where all the pixels for the sky are almost identical, a smaller bit of data is stored which tells the software that will uncompress the image that some region of the image can be replaced with an array of pixels that have the same value.

JPEG can be very lossy or not very lossy. You can achieve a smaller file size by increasing compression which will be more “aggressive” about replacing portions of the image with identical pixel values. Less aggressive compression will look better, but the file size will be larger.

Other “lossless” compression formats are TIFF, PNG, GIF, RAW, PSD and many others.

jballou's avatar

Speaking from the perspective of a graphics/audio/video guy here, XCNuse has got some of it confused (no offense)

Lossy/Lossless is more related to the way you save/export the file. Usually for images, common file types are jpg, gif, or png. These are usually all lossy formats because when you save them, whatever program you’re using uses a compression algorithm to get rid of information you can lose for the sake of a smaller file size. For jpg, for example, most programs get rid of redundant color information. (So if 2 pixels are next to each other, and are the same color, jpg will get rid of the color information for one of those pixels and just borrow the information already saved for the pixel next to it and reapply it)

Music is similar. Mp3 is a Lossy format because it is compressed when saved/exported.

Something lossless doesn’t compress at all. But it can be tricky because the file extensions might actually be the same as lossy files. For example, when saving a photo as a tiff, you can choose to compress it (making it lossy) or you can choose to leave it uncompressed (making it lossless)

Having a good understanding of lossless vs. lossy has more to do with the programs you’re using to create these files and not as much with the file extensions.

xyzzy's avatar

@jballou, you don’t have it quite right.

Lossless simply means that you can undo the compression and end up with exactly byte-for-byte what you started with. Lossless is still compression; it’s just perfectly reversible. Lossy compression on the other hand, throws away information that is lost forever.

ZIP is probably the most widely know example of lossless compression. When you unzip a file, you always get back the exact file you compressed – with no changes. Very good for text documents and spreadsheets. MP3 and Jpeg are popular examples of lossy compression. Uncompress these and you end up with something very close (but not exactly the same as) to the original file.

For archival purposes, lossless is always preferable. For everyday use where storage space is limited, lossy is preferable.

jballou's avatar

Like I said, I’m speaking from the perspective of a graphics/audio/video guy. When you’re working in those mediums lossless is literally an uncompressed file.

:-P

XCNuse's avatar

true it has to do with saving or exporting, but who really thinks about when you are working with it live, I mean for the sake of being simple, it makes sense, but if you want to get technical, then no, when you open any file or whatever loaded into the memory it isn’t compressed, rather it is raw and can be easily changed by I/O devices, and is done so to make things faster and “losless” while working with anything, until it is saved to a form of hard drive space or whatever.

But for the sake of the question, keeping it simple just makes sense lol.

I never opened up a png or jpg so ive never seen the fileatrix compared to a lossless format, but what tall said makes sense and was how I figured it would work, was just confused how it would look in sense of numbers etc. compressing in computers to me is just a miracle to me lol I dont understand how it works, but thats for another time.

tvilot's avatar

jballou, I don’t think that’s quite right. Compressed TIFF can be either lossy or lossless.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther