No video

The Problem with JPEG - Computerphile

  Рет қаралды 593,797

Computerphile

Computerphile

9 жыл бұрын

Never use JPEG with text. But why? Image Analyst Mike Pound explains what goes wrong when JPEG tries to compress text.
Holy Grail of AI: • Holy Grail of AI (Arti...
Computer That Changed Everything: • Computer That Changed ...
Arduino Hardware: • Arduino Hardware - Com...
How JPEG Works: • How JPEG Works
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Пікірлер: 422
@BertGrink
@BertGrink 9 жыл бұрын
Another area where i find that JPEG falls short is in technical drawings, such as electronic circuit diagrams. I am an electronics hobbyist, and therefore often consult datasheets of various ICs, but i find that many, especially older, datasheets are often difficult to decipher due to artifacts. Just my two cents.
@PeterAuto1
@PeterAuto1 2 жыл бұрын
basically everything made out of lines and flat colors
@DripDripDrip69
@DripDripDrip69 2 жыл бұрын
You use PNG for those things
@ericheiner8183
@ericheiner8183 2 жыл бұрын
Honestly things like technical drawings and text probably are better stored in vector formats like svg or pdf.
@phinix250
@phinix250 2 жыл бұрын
@@DripDripDrip69 I use black and white TIFF files mainly since there is often no colour info required
@DripDripDrip69
@DripDripDrip69 2 жыл бұрын
@@phinix250 PNG can be 8 bit or 16 bit grayscale. TIFF have different compression methods, some lossless some lossy.
@Niosus
@Niosus 9 жыл бұрын
Interestingly enough, the "no JPEG for scientific images" statement is a very real consideration for space missions. Now I'm pretty sure they don't actually use JPEG, but for New Horizons which is about to encounter Pluto, ALL of their images will be compressed in a lossy way. At that distance, bandwidth is very limited resource. Since they'll be flying past Pluto at a ridiculous speed, they have opted to apply lossy compression so they can get significantly more data back home. A good knowledge of what kind of compression artifacts are caused by the specific algorithm in use will be required to thoroughly clean up and analyze the images.
@xwolpertinger
@xwolpertinger 9 жыл бұрын
Niosus all those people that see artificial alien structures on other planets (because they are looking at compressed images) are going to have a field day
@Niosus
@Niosus 9 жыл бұрын
wolpertinger Yeah... Ah well, they see that on Moon images as well, after they copied a low-res JPEG thumbnail off some website and blew up the contrast, brightness, levels and whatever slider they could find. And if they can't find anything, it's because it is air-brushed! "Evidence" for the conspiracy supports it, evidence against the conspiracy also proves that there's a conspiracy. There's no point in giving them any attention at all.
@FirstDagger
@FirstDagger 9 жыл бұрын
Niosus The problem is that "Media" is giving them attention, and that people without scientific-thinking are buying into those false believes.
@BGBTech
@BGBTech 9 жыл бұрын
Niosus AFAIK, NASA generally uses VQ based image compression (loosely similar to texture compression on the PC), and then further compresses this with an LZ77 variant (LZO), which is loosely comparable to Deflate (just is a little computationally simpler due to not using Huffman coding).
@Niosus
@Niosus 9 жыл бұрын
Brendan Bohannon According to Stuart Robbins, one of the scientists working with New Horizon's data (mostly focused on craters) and also a podcaster, they use JPEG for (at least some of) the images. He posted a while back that there was something that looked very much like a crater but turned out to be a JPEG artifact. Obviously I didn't know this when I posted my initial comment. If you want, I can try to dig up his post for the sake of providing a source? However this is just the first batch of images. If I recall it correctly, it will take over 2 years to transmit back all the data in its full glory. As long as you know the downsides of JPEG, there are a lot of things you can still learn from those images. The finer details will come to light when the scientists get their hand on the full resolution/quality images.
@theblackwidower
@theblackwidower 7 жыл бұрын
He mentions text, but this applies to anything that's not a photograph, basically. Drawings and animation are the same, it's the sharp lines you want to preserve, not the general swaths of colour.
9 жыл бұрын
People shoot in RAW not because of end result as-is, but because of the data in the image that can be used to edit the photo.
@hikari_no_yume
@hikari_no_yume 9 жыл бұрын
Ah, similar to why mastering uses high bit-depth audio, then?
9 жыл бұрын
TazeTSchnitzel Exactly.
@TheMajorJF
@TheMajorJF 9 жыл бұрын
Toni Lähdekorpi And often you can fully re-expose the image in photoshop or similar if you have all the raw data.
9 жыл бұрын
It's still a bad idea to not use JPEG or WebP if you want to share the final versions of your photos on the web, since they are only meant for viewing.
@TheMajorJF
@TheMajorJF 9 жыл бұрын
It seems we are in agreement. If you want to be able to do post processing on an image capture RAW. Afterwards, for the love of bandwidth, save the final as something else.
@TheBrickson98
@TheBrickson98 8 жыл бұрын
I usually don't have an issue picking up on stuff as I watch an informational video, but there's so many technical details in this, that I need to go watch that "how a jpeg works" video, and come back to this. I love it though. Learning the in depth details about something makes me feel like I actually know how it works. I always need to know the how and the why down to the smallest detail before I'm satisfied. This channel makes me research so much, and like I said before, I love it.
@gfetco
@gfetco 9 жыл бұрын
JPEG is the reason why some people believe in Aliens on earth.
@gfetco
@gfetco 9 жыл бұрын
***** And you throw the most overwhelming fallacies I've ever heard of thus far.
@12togo34
@12togo34 8 жыл бұрын
+Joaquin D (Joax) dude, HOW. you cant just read 1 sentence and claim that that guy is the reason why people dont believe in the future of humanity. come on. infact, how could anyone not believe in the awesome future of humanity? humans have been getting better and greater for a long time. they can literally only get better.
@davecrupel2817
@davecrupel2817 8 жыл бұрын
And you call yourself "Enlightenment" change your name, or it will be changed for you.
@sellihoozhun
@sellihoozhun 8 жыл бұрын
+Daniel Cannata top kek
@fy8798
@fy8798 8 жыл бұрын
+Enlightenment Lots of angry Aliens Guys in the comments. Amusing.
@parasharkchari
@parasharkchari 9 жыл бұрын
When I first started working in film, I was actually surprised when I found out the extent to which they used JPEG for pretty much anything that didn't have to be HDR, which I presumed at the time to be too artifact-ridden to be of any use. That said, it wasn't standard "web" JPEG. It was generally 16-bit-per-channel, and mapped to Rec.2020 or DCI-P3 gamut rather than sRGB. The idea with 16-bits per channel was based on the hope that the quantization errors like those described in the video would be reduced to such a small order of magnitude that they'd not be noticeable, and you'd anyway be mixing this with all nature of modifiers to the extent that errors like that would get lost in the mix. That said, it's not as if we used high degrees of compression either, but JPEG at 98% quality is still significantly smaller than anything lossless, so that was the real point. Counts for a lot when you've got several hundred GB of data shuffling about for a single 20-second shot.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 6 жыл бұрын
The term for those artifacts is “mosquitoing”. They are the image equivalent of “ringing” in digital audio.
@TheDementation
@TheDementation 2 жыл бұрын
Nearly everyone has forgotten about variable jpeg compression within the same image. You can apply different levels of compression to different parts of the image - selective optimization.
@mousaey
@mousaey 2 жыл бұрын
Is it possible to learn this power?
@bluesailormercury
@bluesailormercury 2 жыл бұрын
Does that mean that it is possible for a jpeg to get progressively worse? Do modern programs use jpeg in this optimized way?
@ScarfmonsterWR
@ScarfmonsterWR 2 жыл бұрын
@@bluesailormercury I know Photoshop allowed this in the past, but you had to manually set the mask and pick compression values. I haven't heard of any current software that does this. Also, yes, in theory you could have areas with 100% and 0% quality in the same image. I don't think it worked like a gradient though, you just maksked areas that should have used less compression and that was it.
@Fummy007
@Fummy007 9 жыл бұрын
Do I look like I know what a jpeg is?
@Fummy007
@Fummy007 9 жыл бұрын
Fair enough
@rosebuster
@rosebuster 7 жыл бұрын
No. No, you don't. :P
@sonicbro6446
@sonicbro6446 3 жыл бұрын
i just wanted a picture of a damn hotdog!
@Yazan_Majdalawi
@Yazan_Majdalawi 4 ай бұрын
​@@sonicbro6446 lol
@PrimeSonic
@PrimeSonic 9 жыл бұрын
I've been loving this series. I'm hoping we get to see something about PNG compression sometime.
@Khaltazar
@Khaltazar 9 жыл бұрын
I prefer using .png most of the times for small images the file size is smaller, and the image quality is better. I'm not sure at what size .jpeg files become less file size than .png, but .png works for my purpose.
@Folopolis
@Folopolis 7 жыл бұрын
Unless you are using a pointless level of compression, JPEG should always be smaller than PNG.
@Wildcard71
@Wildcard71 7 жыл бұрын
I did a file size comparison at a set of bars (which represent a flag). In this case, PNG was the smallest.
@circuit10
@circuit10 4 жыл бұрын
@@Folopolis Not for really small images because PNG can compress those well and JPEG probably has overhead from storing the things needed for the compression to work
@nickfifteen
@nickfifteen 2 жыл бұрын
@@circuit10 in my experience, PNG is only better than JPG at sizes of like, 50x50 or 100x100. Anything higher, and JPG wins out almost all the time for all practical purposes. Like, of you're gonna use PNG at 500x500, you might as well just use JPG at 100% compression, and you'll likely still get a smaller file size. Of course this doesn't count if the image is mostly text and/or dealing with low colors like clip art and rasterized vector graphics.
@Phil8719
@Phil8719 2 жыл бұрын
It's not so much about the size but how much of the image is blocks of one colour that decide whether a .png will be a smaller file than a .jpg. Generally .png is always a smaller file for things like screenshots of computer programs or web pages. You can easily try this out by saving a screenshot of these KZbin comments as .jpeg and .png - so much of the image is single colour background that the png should be a much smaller file and would have no loss in quality because (I think) it's lossless.
@LurkerPatrol5
@LurkerPatrol5 2 жыл бұрын
As an astronomer I have to interject here. I run an imaging camera onboard a telescope and all our files are in the FITS format architecture. We need to retain the exact photon values for each pixel in order to be able to accurately measure stellar photometry, spectra (via grism), and to look for any artifacts. JPEG would completely compress this data making it completely poor for real science. Plus the issue of going from high luminosity to low luminosity would be a major issue with JPG given that stars basically go from thousands or even tens of thousands of photon counts to effectively 0 for space. Cosmic rays are even worse than that because they're not gradual like stars are with their 2D gaussian like profiles.
@schmetterling4477
@schmetterling4477 2 жыл бұрын
Astronomy is an example of extremely wide dynamic range data (there are others, like audio and data from seismometers). Technically JPEG doesn't even solve the photography problem, as it assumes that images are "flat" to eight bit, already. That's nowhere close to the actual dynamic range of typical terrestrial scenes, either. It's a file format that needs to disappear. It is obsolete now that we have sensors capable of 16 bit of dynamic range and more.
@markoposavec9240
@markoposavec9240 2 жыл бұрын
@@schmetterling4477 I agree JPEG and sRGB need to die already. Also the abysmal state of color management across the devices. We should have had HDR displays 10 years ago. Considering the colossal importance of imaging the improvements are made at a glacial pace.
@schmetterling4477
@schmetterling4477 2 жыл бұрын
@@markoposavec9240 Absolutely. Let's hope that image data handling will finally catch up with physics now that the displays (almost) have.
@MechMK1
@MechMK1 2 жыл бұрын
The whole "shooting in RAW" thing is like this: During the entire production chain of a photograph, you want to keep as much information as possible. Only during the final step, publishing, it makes sense to publish as JFIF to get some "workable" file sizes. Same for any other industry (video, music, etc...)
@henryhbk
@henryhbk 2 жыл бұрын
Well the biggest issue that raw solves isn’t the lack of the ringing artifacts (say if you photograph text) it’s more for preserving color and luminance. And when color grading video or white balancing a photograph if you’ve run it through a lossy block compression the color cast you are trying to correct out has been altered randomly per block due to the compression. Best way to look at this is to take a jpeg and look at the color histogram after compression and you see these spikes which is where the algorithm has crushed the colors into bands.
@xavinitram96
@xavinitram96 9 жыл бұрын
We want more videos with Mike! Those videos about graphics are just awesome!!!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 6 жыл бұрын
Around about 1990, back when hard drives were a lot smaller and people still used floppies a lot, JPEG was an absolute revelation. The idea that you could take a photorealistic image and reduce the file size by a factor of 10 with no perceptible difference in image quality was stunning.
@GimliTehDwarf
@GimliTehDwarf 8 жыл бұрын
What an amazing series! Thank you Ive always wanted to figure out how that works and now I have a much better idea. The guys that came up with these compression methods are genius!
@Soundole
@Soundole 8 жыл бұрын
I've found this series about JPEG compression extremely fascinating and enlightening - thanks for putting them together!
@yqisq6966
@yqisq6966 8 жыл бұрын
My choice of formats are: eps for line art, png for schematic diagrams, and jpg for photographic images.
@ShankarSivarajan
@ShankarSivarajan 3 жыл бұрын
.svg files are better for line art.
@spicybaguette7706
@spicybaguette7706 2 жыл бұрын
@@ShankarSivarajan eps doesn't support transparency AFAIK
@Chxxvo
@Chxxvo 2 жыл бұрын
.EPS doesn't support transparency, I'm afraid. My own choice is... SVG for line art. PNG for schematic diagrams JPG for photographs
@mgord9518
@mgord9518 2 жыл бұрын
SVG for line art, webp for schematic diagrams, and webp for photographic images
@jumzbrugs9867
@jumzbrugs9867 2 жыл бұрын
My preference: HEIC for nothing JPEG for everything else Oh and pdf for text 😁
@MichaelJE2
@MichaelJE2 9 жыл бұрын
The difference between JPEG and RAW is *more* than just compression, it also loses additional sensor data that makes JPEG images harder to edit after the fact. It is extremely difficult to fix JPEG white balance in post for example, but it is very simple to do with RAW.
@danmanx2
@danmanx2 2 жыл бұрын
I still credit JPEG for speeding up the early internet. Anybody still remember BMPs/GIFs as the common format on early internet? It used to take a few MINUTES to render a picture. Let that sink in a bit.....
@lemonke8132
@lemonke8132 2 жыл бұрын
Why is the sink at my door again?
@VenetinOfficial
@VenetinOfficial 2 жыл бұрын
@@lemonke8132 You gotta let it in bro. Let that sink in…
@Gogglesofkrome
@Gogglesofkrome 2 жыл бұрын
@@VenetinOfficial this is starting to go down the drain
@deeliciousplum
@deeliciousplum 2 жыл бұрын
After all these years of being troubled by the appearance of speckles, this Computerphile upload helps me to better understand their presence. When making a collage where some of the images used had text with speckles, it added to the time needed to make the collage. Cleaning up the speckles is such a chore.
@rogerdinhelm4671
@rogerdinhelm4671 8 жыл бұрын
Please, make a video about JPEG2000, it is largely unknown but interesting technology.
@glennzone12
@glennzone12 7 жыл бұрын
And a video about webP
@habdochkeineahnung
@habdochkeineahnung 8 жыл бұрын
that dude changed for good. i havent seen the old videos for a while.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 6 жыл бұрын
There is another problem with JPEG, and that is if you push the compression too hard even on images without sharp edges in them, it ends up looking blocky. There is another compression technique, known as “JPEG-2000”, that uses wavelets instead of DCT. Here when you push things too hard, it gets fuzzy rather than blocky, which many people feel is less objectionable.
@numan6693
@numan6693 2 ай бұрын
After 8 years. Still one of the best Videos to JPEG Compression
@koustavbhattacharyya
@koustavbhattacharyya 9 жыл бұрын
This series is awesome !! MOAR of this please !!
@power-max
@power-max 8 жыл бұрын
+Computerphile Could you do a video discussing techniques for interpolation in general, covering the different methods and algorithms used to accomplish it?
@drugmonster6743
@drugmonster6743 9 жыл бұрын
This guy is great, more of him! Do WebP next.
@rkpetry
@rkpetry 7 жыл бұрын
Paradoxic definition points: 1. Did JPEG'ers not-understand that they were to remove, high-frequency artifacts, not just not-compute them... 2. GIF'ers had a similar trouble with pixel-quantum-level speckles that realistically indicated lower-frequency threshold-crossing....
@isaacc7
@isaacc7 9 жыл бұрын
As others have pointed out, shooting in Raw is done for greater flexibility when it comes to editing images. It would be great if you could do a video explaining the processes behind adjustments like brightness, white balance, etc. Then maybe talk about the advantages of higher bit images, sounds, or other information when it comes to adjustments. There is a huge practical advantage to editing 12 bit files as opposed to 8 bit JPEG images. Come to think of it, is the greater flexibility due to the lack of JPEG processing, the greater bit length of Raw files, or both? Another good video idea...
@Sweetw4ter
@Sweetw4ter 9 жыл бұрын
Mike Pound is awesome, more of him please!
@rich1051414
@rich1051414 Ай бұрын
It's worth pointing out that even at minimum compression, as in, you don't low pass filter the DCT values at all, the output image still isn't exactly the same as the input. Its very close, but not the same.
@XxHRITxX
@XxHRITxX 17 күн бұрын
Hey! I'm really interested in the JPEG image compression and am conducting my own research as a high school student on the same. I am not very proffiicient in coding but I want to explore this using mainly mathematics. I am having difficulty finding code or libraries that I can use reliably to get values like yours in the videos. I would really appreciate if you could share that. Thank you!
@frustbox
@frustbox 9 жыл бұрын
»Most people swear by shooting in raw and good luck to them?« What does he mean? Seemed like he was scoffing. The reason for shooting in raw is, that you get the actual uncompressed "raw" data from the CMOS sensor of the camera. Which is brilliant if you want to do any kind of post processing with the image. Colour corrections, contrast etc, or even more elaborate manipulation. You don't want to lose information before you've done that. It always depends on what you want to do with the file. If you are a photographer or a graphics artist who wants to do some post processing and image manipulation: get the image as clean as you can, don't lose any information you may later need -> lossless! If you want to archive the image long term, then some lossless format may be a good idea as well. It depends a bit on storage cost. If you want to distribute the image for display on the web, then save bandwidth, compress the image and use jpeg. (although png seems like the better choice to me) Bottom line: Shoot in raw if possible, process the image, then convert to other file formats for archive/distribution.
@oBCHANo
@oBCHANo 9 жыл бұрын
frustbox He was probably just trying not to offend anyone that actually uses JPEG, there is a few people left still using it that defend it as much as possible despite their arguments being about as valid as a creationists.
@frustbox
@frustbox 9 жыл бұрын
oBLACKIECHANoo Oh, well, yes, that's one way to look at it. I'm going to re-calibrate my sarcasm detector. ;)
@michaelpound9891
@michaelpound9891 9 жыл бұрын
Heh, I may have been scoffing a little! I should probably have explained it better. I have no issue with shooting in raw then converting later. However, I do disagree with those claim that anyone shooting in Jpeg is inherently bad at photography. There are obvious benefits to both approaches.
@oBCHANo
@oBCHANo 9 жыл бұрын
magottyk Ye, RAW is just undeniably better quality and far more flexible. The only time you would sacrifice that is for the burst mode and not having to edit, which is only useful for time sensitive reporting, like sports. However if somebody is shooting weddings on JPEG they are a horrible photographer, jpeg by default makes their hit rate and final product worse and they aren't providing the service they should be.
@magottyk
@magottyk 9 жыл бұрын
oBLACKIECHANoo I'd sack any photographer who couldn't provide me with the raw images on request. Considering that today we have uhdtvs with a resolution of 3840x2160 which is about 8 mega pixel equivalent and not in the same aspect ratio as cameras (you'd want at least a 12 MP cropped image to suite 1:1), with the next gen standard to be double that again which equates to 32MP and again a different aspect ratio. Those displays will show up all the flaws of JPEG. and yes I can see the boxing artifacts of JPEG and I've got crappy eyesight. Where once we were constrained by technology, that is no longer the case. If you're paying for the images from a professional, then they have no excuse to be shooting in JPEG only. Consideration can be given to any continuous shooting sequence as that is still constrained by technology.
@NeoTechni
@NeoTechni 2 жыл бұрын
It sounds like JPEG should have been built to detect these high-frequency blocks and just give up and leave them uncompressed
@Gogglesofkrome
@Gogglesofkrome 2 жыл бұрын
alternatively jpeg could have had a process to subdivide blocks that are particularly busy into smaller ones, compressing the blotchy and underutilized expanses of color and space around the busy regions, however this would have only mitigated the problem of the blocky artifacts, rather than completely eliminate them. Granted ideally the blocks would be much smaller
@NeoTechni
@NeoTechni 2 жыл бұрын
@@Gogglesofkrome that would also work
@j7ndominica051
@j7ndominica051 9 жыл бұрын
When I saw the title, I thought you will discuss blocking and lack of "overlap" in the transform to counter it, as described in, "Applying the MDCT to Image Compression" or the upcoming Daala standard.
@teslastellar
@teslastellar 4 жыл бұрын
RAW usually has between 12 to 16 bits per color (14 being most common) vs 8 bits for JPEG. You might not be able to see it straight out of the camera but in editing you can pull out details in highlights and shadows. So for any serious editing, you'd be better off with RAW.
@ChristianAkacro
@ChristianAkacro 9 жыл бұрын
That was great! Those artefacts have always driven me nuts, and now I know why!
@DaveMakes
@DaveMakes 9 жыл бұрын
fantastic video series, thanks very much for making it.
@MrTridac
@MrTridac 9 жыл бұрын
I like this series. More from Mike, please.
@DanielJohnNicholson
@DanielJohnNicholson 8 жыл бұрын
The best way to fix this problem is to use PNG
@TheMrKeksLp
@TheMrKeksLp 8 жыл бұрын
Yeah. Sorry jpeg, everyone hates you.
@FrankHarwald
@FrankHarwald 8 жыл бұрын
+Some Person JBIG2
@BigOlSmellyFlashlight
@BigOlSmellyFlashlight 7 жыл бұрын
nah gif is better than the rest. *sarcasm*
@TheMrKeksLp
@TheMrKeksLp 7 жыл бұрын
Pff I use .ico for all my images
@BigOlSmellyFlashlight
@BigOlSmellyFlashlight 7 жыл бұрын
but thats desktop icons. i use .acur for my animations
@marcfuchs6938
@marcfuchs6938 2 жыл бұрын
As an artist and graphic design specialist, I often use formats as PNG, however JPEG is still awesome and I use it for various purposes. Depending on compression, final images do look absolutely awesome in it. But it really comes down to image content, if it even makes sense to be used. A lot of details (like in photos) make JPEG relevant, but if there is a lot of plain coloring, PNG usually makes a lot more sense, because PNG always retains original, uncompressed colors, but still can be compressed and so images with big areas of same coloring can even be smaller in file size than JPEG. Both formats were first released in the 90s. For that, they are still highly relevant and awesome.
@maximiliandc2
@maximiliandc2 9 жыл бұрын
Please do a series on mp3 or other audio compression methods!
@Knigh7z
@Knigh7z 9 жыл бұрын
1:41, are the 51s and 55s supposed to be 151s and 155s? just caught my eye lol
@seanski44
@seanski44 9 жыл бұрын
No but in hindsight I think my 8x8 logo was slightly differently cropped than Mike's hence the numbers not quite matching up - good spot tho!
@vlk.charles
@vlk.charles 9 жыл бұрын
Knigh7z Actually, none of the numbers correlate with the colors.
@Knigh7z
@Knigh7z 9 жыл бұрын
I see, thanks
@1eikaramba1
@1eikaramba1 9 жыл бұрын
But if you use a reasonable high quality factor(low compression) then you end up having a non-visible loss of quality while at the same time a better compression than e.g. png. We testet this ourself with a lot of documents, and on mobile it is just not worth sending a 4mb(or even more) png, whereas an image with jpg is only 600kb or so and looks really the same (you don't see any difference even on a pixel basis)
@narrowkeel
@narrowkeel 9 жыл бұрын
This is probably my favorite channel on youtube.
@jmm1233
@jmm1233 8 жыл бұрын
i found best way to deal with speckle , is add a shadow behind text that is grey to transparent to background , and never use red text on blue
@smegskull
@smegskull 9 жыл бұрын
Why does it screw up a solid white bitmap? Surely that should just be 100% wave 1 and decompress back to solid white but it comes out as different shades of grey and beige.
@fllthdcrb
@fllthdcrb 9 жыл бұрын
smegskull If it's _really_ just a single color in a block, it _will_ preserve that with just the DC coefficient (though the exact color might vary due to colorspace conversion). The problem comes when you have sharp details within the same block. Then you have waves that cover the entire block, and compression that gets rid of some of the waves that would cancel where the solid color should be.
@smegskull
@smegskull 9 жыл бұрын
Daniel Dawson It doesn't though. I get it when I use paint all the time If I save as a bit map and use the paint fill it fills everything but If I do it with a jpeg I end up with clouds everywhere because huge chunks of white are now just off white.
@fllthdcrb
@fllthdcrb 9 жыл бұрын
I'd say that's a problem with the software, then, or there's something you're not understanding somewhere. I just tested it with GIMP, an open-source application along the lines of Photoshop. Created a small solid pure white image, saved it as JPEG, *minimum possible quality setting*, unoptimized, etc. Opened it back up. It's still a perfect solid pure white. Conclusion: JPEG has no problem with solid-colored blocks. My advice: try something other than MS Paint (if that's what you were referring to). It's not known for being great graphics software anyway.
@666Tomato666
@666Tomato666 9 жыл бұрын
Daniel Dawson "try something other than MS Paint. It's not known for being great graphics software anyway." You Sire, win the Understatement of the Week Award!
@Mostlyharmless1985
@Mostlyharmless1985 6 жыл бұрын
Wouldn't it be smarter to use a format that incorporates RLE + LZW in that situation anyway? You are crashing a car in the wall, then yelling at the engineer because you didn't understand how a steering wheel works.
@ViktorEngelmann
@ViktorEngelmann 4 жыл бұрын
Why don't they check the euclidean-distance between the original image and the quantized image? If it's to high, they could decide to store that block uncompressed or try a different quantization matrix...
@tankermottind
@tankermottind 8 жыл бұрын
Why do image and video compression treat red text even worse than other text?
@Gnomefro
@Gnomefro 8 жыл бұрын
+tankermottind It's not just red text. It's very common to downsample the color information to half or a quarter of the pixels in the original image because humans have poor color vision compared to their ability to differentiate intensity so colored text will have been screwed up a bit even before the normal compression takes place. In any case, jpeg and mpeg was designed to compress natural images, not artificial ones containing fonts that are one pixel wide.
@tankermottind
@tankermottind 8 жыл бұрын
Gnomefro I just know that in video footage of FreeSpace 2, HUD graphics and text in red are always harder to read than any other color (green usually being the easiest).
@faissalbensefia7001
@faissalbensefia7001 9 жыл бұрын
This is why I use PNG
@BeatleFloydZeppelin
@BeatleFloydZeppelin 9 жыл бұрын
Faissal Bensefia PNG has its place, but isn't great for everything. PNG-8 is similar to GIF, but it can store a single alpha channel. Unfortunately it can only store 256 colours which makes it bad for photographs. PNG-24 is fantastic because it can store thousands of colours including multiple alpha channels, but it will be a much larger file size compared to JPEG (like 5X), and won't be noticeably better quality then JPEG. So you shouldn't always be using PNG or JPEG. You need to switch the file type depending what the image is, and how you intend on using it.
@faissalbensefia7001
@faissalbensefia7001 9 жыл бұрын
BeatleFloydZeppelin I use PNG 24 with 0 compression as long as there's no file limit because I hate how much of a degradation in quality JPEG causes
@faissalbensefia7001
@faissalbensefia7001 9 жыл бұрын
***** Not sure if sarcasm ﺟ_ﺟ or serious
@erikziak1249
@erikziak1249 9 жыл бұрын
Faissal Bensefia for screenshots
@bayraktarx1386
@bayraktarx1386 9 жыл бұрын
Faissal Bensefia if you have so much text just put it in text document, or use JPEG in normal resolution.
@Zeturic
@Zeturic 9 жыл бұрын
Why not just programmatically determine the quantization table to use, based on the cosine waves that are most / least common in the image? Because the file keeps the table, I don't see any reason to use a static quantization table for all images, other than that it would make compression faster (and it's usually "good enough").
@volundrfrey896
@volundrfrey896 9 жыл бұрын
You can't shoot in jpeg, you're camera always shoot in RAW. Then it can convert it to jpeg. But doing so it makes decisions about white balance, colour balance, added sharpness, enhanced contrast and more. That's why we shoot in RAW, to let us decide how the final image will look and not let the camera decide.
@helloitismetomato
@helloitismetomato 2 жыл бұрын
I can't wait for AVIF support to become as common as jpeg. It blows both jpeg and WebP out of the water in quality/size, and it also supports 10 and 12-bit images. (imo the fact that almost everything is still on 8bpc is one of the most ignored shortcomings of modern image compression systems.)
@soraaoixxthebluesky
@soraaoixxthebluesky 7 жыл бұрын
I trying to avoid using jpeg but my storage was like "no. don't you ever try to think about it"
@eliastandel
@eliastandel 8 жыл бұрын
Is it possible to make a different quantization table for text-heavy images that minimizes these artifacts?
@djmips
@djmips 7 жыл бұрын
yes.
@roderik1990
@roderik1990 7 жыл бұрын
Theoretically yes, but said quantization table might not be as generally applicable.
@LudwigvanBeethoven2
@LudwigvanBeethoven2 5 жыл бұрын
Or you could just use png for that kind of image
@davidtan8984
@davidtan8984 8 жыл бұрын
Re-encoding doesn't result in generation loss? In theory yes, but in consumer software it actually does get worse after hundreds of saves. Is this because the quantization table changes for each save, or is the quantization table static and there's another reason?
@homeycdawg
@homeycdawg 9 жыл бұрын
Seems to me that jpeg is best for fast loading pictures on web pages.
@magdabrownis265
@magdabrownis265 2 жыл бұрын
James Rolfe from Cinemassacre and Ian Ferguson from CUPodcast had a British baby and it’s this guy
@JimPfaff
@JimPfaff 2 жыл бұрын
You should link the video which describes the 300dpi problem as a comparison to this one. The concepts are quite similar.
@therollingjonicle
@therollingjonicle 6 ай бұрын
This is so great! Thank you very much for making these videos!
@cinegraphics
@cinegraphics 8 жыл бұрын
*For text use PNG format, not JPG*. Because PNG after decompression returns the same image that was on input. Exactly the same bit-by-bit as uncompressed, and yet it's smaller. JPEG files are even smaller than that, because JPG irrecoverably throws away some of the input data. When compressing computer generated (not scanned) black and white text (for example screen grab of a Windows application where there's no images on screen) PNG can produce smaller images than JPEG. So with simple text and graphics (that has no noise) PNG outperforms JPG in both the quality and file size.
@zeidrichthorene
@zeidrichthorene 9 жыл бұрын
Something I noticed that wasn't really mentioned was that the colored text looks much worse than the black and white text. I'm guessing that's because of what you said earlier that the chrominance gets compressed even more strongly than the luminance. So red text especially looks very washed out. I've noticed that before on other compressed things, red text on video often looks awful. I'm guessing it's essentially the same thing, if you don't expect small changes in luminance, you certainly don't expect small high frequency changes in chrominance. I never quite knew why that was, just that it was annoying.
@ThrashmIO
@ThrashmIO 9 жыл бұрын
I'd propose a hybrid type or a newer version of jpeg that supports non-compressed regions that a user with an editor could select text areas to exclude compression in the particular locations.
@NormReitzel
@NormReitzel 2 жыл бұрын
Very interesting. I never knew that jpeg does to visual data the same thing "telephone" codecs do to voice.
@mountp1391
@mountp1391 2 жыл бұрын
This video is so helpful regarding ICT fundamental principle.
@DFX2KX
@DFX2KX 9 жыл бұрын
JEPEG also has that artifacting when scanning drawings, worse if you drew with ink or a darker lead.
@FloydMaxwell
@FloydMaxwell 2 жыл бұрын
would have been nice to see a comparison with SVG & PNG
@ShiroKage009
@ShiroKage009 9 жыл бұрын
"Lots of people swear by swearing in raw," like yours truly :P
@deathstroyer
@deathstroyer Жыл бұрын
jpeg was made specifically for photographs, for other images png is superior as it has powerful lossless compression.
@pankajchoudhury857
@pankajchoudhury857 6 жыл бұрын
If i use jpeg image for a digital image processing will the lossy compression effect my results??? What about bmp, will it effect it??
@LastofAvari
@LastofAvari 9 жыл бұрын
This video needs more JPEG artifacts =) #PNGMasterRace
@phs125
@phs125 6 жыл бұрын
LastofAvari I had to use 2g for last 2 days, i know how i feel about uploading a 5MB png and 119kb jpeg With 8KBPS OF AWESOME SPEED!!!!
@xanokothe
@xanokothe 9 жыл бұрын
How about compressing areas in different rates? For example. Mostly of the image would be compressed with 90%, but the text area would be compressed with 10%
@StigHelmer
@StigHelmer 9 жыл бұрын
Xano Trevisan Kothe Modern image compression formats support features just like that.
@MaicahRu
@MaicahRu 9 жыл бұрын
Xano Trevisan Kothe wavelet compression
@xanokothe
@xanokothe 9 жыл бұрын
Mike Johnson wavelet? I did a project using it(Wavelet algorithm 1-D, 2-D, and 3-D). And I was not satisfied with the result.
@codebeard
@codebeard 9 жыл бұрын
Xano Trevisan Kothe The problem is, how do you know where the text is? All you have is low and high frequency data. High frequency data might indicate text, or it might just indicate random noise which can be thrown away with no perceptible loss of quality.
@MaicahRu
@MaicahRu 9 жыл бұрын
You could do the DCT for each block, then, then see whether each block is mainly high or low frequency content, create a low resolution mask for the entire image and use two different weights depending on if its a high frequency or low frequency area
@imedman1
@imedman1 8 жыл бұрын
You should make a video about MPEG!
@lejink
@lejink 9 жыл бұрын
So what you're saying is my porn could be in much higher quality?
@hristaki99
@hristaki99 9 жыл бұрын
Dee Jay Only if it's interracial.
@macronencer
@macronencer 9 жыл бұрын
hristaki99 Hahaha! You win today's Internet.
@SuviTuuliAllan
@SuviTuuliAllan 9 жыл бұрын
hristaki99 Not sure if racist or awesome. -.-
@Watupm
@Watupm 9 жыл бұрын
hristaki99 rofl I cried laughing so hard
@hristaki99
@hristaki99 9 жыл бұрын
Suvi-Tuuli Allan In the video he explained that artifacts are caused by sharp change in colour between pixels. nuff said
@yashbutno
@yashbutno 2 жыл бұрын
With images like these, JPEG files sometimes end up being way larger than what would've been the size of a PNG, bitmap, or path format.
@grapes008
@grapes008 8 жыл бұрын
I shoot raw, save in raw, unless I need to upload it some where. Storage space is cheap so that not really an issue. 14 bit raw image gives post processing a lot more flexibility, 32 bit HDR stored in DNG can be a bit of a drag though
@zn9707
@zn9707 8 жыл бұрын
If you find you save a lot of images in raw that you never or rarely look at, what you could do if you ever need to save more space is put them in a compressed archive, say .zip or .tar.gz, and then extract when needed or use an image viewer that supports viewing images in compressed archives whenever you need to look at them.
@BlackJar72
@BlackJar72 9 жыл бұрын
This would be so much better with a link to the actual algorithm, to something the shows the actual math involved in the compression. I'm sure its complicated, but as is its like hearing about variable in an equation without seeing the equation, so it comes across as what everyone already knows with restated in jargon most do not.
@the1exnay
@the1exnay 5 жыл бұрын
Is it possible to use an adaptive matrix? Setting to 0 the ones which will cause the smallest overall changes in the values? Would the way to do that just be to remove the smallest values?
@krisvette5874
@krisvette5874 9 жыл бұрын
When you transfer a JPEG file (either by Sending to another Hard drive or Copy & Pasting) eg backing up photos to second Hard Drive, is there a loss of Image Quality on each successive transfer of the JPEG file or does it remain as the original JPEG quality?
@PaulTheFox1988
@PaulTheFox1988 8 жыл бұрын
+Kris Vette No, a copy paste operation is an exact bit copy of the file, as in, it streams the file from disk into memory and then saves that stream to wherever you pasted it to, without changing anything about the files contents. You can copy a copy of a copy to the nth degree and the last one will be exactly the same as the first. :)
@kanjitard
@kanjitard 9 жыл бұрын
The only users of jpegs with text are women over 40 who share motivational pictures on Facebook.
@ZipplyZane
@ZipplyZane 6 жыл бұрын
Would it be possible to create a Huffman table that is optimized for these sharp changes? Or at least one that is better for text, without having as large a file than if you just used super high quality?
@Eysc
@Eysc 9 жыл бұрын
needs more jpg
@Hades948
@Hades948 8 жыл бұрын
A big downside to JPEG is that it doesn't take alpha into account like PNG does. So then you're stuck with just rectangles. Which is fine is some cases, but with lots of graphical design things, it's not.
@jeffthecoder
@jeffthecoder 7 жыл бұрын
Oh for sure. If you are working with Photoshop, for example, you definitely don't want JPEG source images in your project. JPEG has limited relevance these days (it was mostly useful back in the day when transmission bandwidth was low/expensive) other than it's usefulness as a part of MPEG/MP4 etc compression.
@thudso
@thudso 5 жыл бұрын
Can you do videos on vector graphics at some point? These were awesome.
@culwin
@culwin 9 жыл бұрын
I always use JPG and Comic Sans for the font.
@ddostesting
@ddostesting 9 жыл бұрын
Can't they do a sobel or other edge detection algorithm and whenever there is an edge they use higher quality compression, or max quality?
@amshermansen
@amshermansen 9 жыл бұрын
What I wouldn't give for a hybrid between JPEG style compression methods and a second "layer" with rendered text. Changes are it would be smaller than a lossless format anyway.
@totoritko
@totoritko 9 жыл бұрын
Mansen EPS can do this. It can include an arbitrary mixture of raster graphics with JPEG compression and vector graphics and is still primarily an image format (so it's embeddable), not a full document.
@SUFHolbek
@SUFHolbek 9 жыл бұрын
Mansen why not just save in near-lossless format then?
@amshermansen
@amshermansen 9 жыл бұрын
Scoldpedia Because you lose the sharpness of text when you rasterize it.
@yondaime500
@yondaime500 9 жыл бұрын
Mansen For that you'd need OCR to read the text from the image and inpainting to calculate what's behind the text. But these technologies are currently neither completely accurate nor fully automated. I think a format like that would require AI and computing power that we don't have yet. But maybe in a few years.
@amshermansen
@amshermansen 9 жыл бұрын
yondaime500 Uh... no you don't. OCR is reading text FROM an existing image. I am talking about the original production of said image with text separate from raster layers... As Totoritko mentions, EPS can do this - So can "workspace" formats like PSD, but those are far too heavy to share, and won't show in browsers anyway.
@aquarius5719
@aquarius5719 2 жыл бұрын
Where can I learn about coding to make JPEG or BMP images?
@m.sierra5258
@m.sierra5258 2 жыл бұрын
"A lot of people swear on shooting in raw"... Lol. Of course they do, if you want to post process. But once you are done post processing, I would convert it back to jpeg... Try brightening up a jpeg, it's almost impossible. It looks horrible.
@Roshkin
@Roshkin 9 жыл бұрын
For text, why not invert it and assume no low frequency and only high?
@user-ld4qt6ci7b
@user-ld4qt6ci7b 4 жыл бұрын
The real problem with jpeg is using it more than once.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 6 жыл бұрын
1:00 “High frequencies” i.e. image-processing-speak for “sharp edges”.
@predictless1009
@predictless1009 2 жыл бұрын
When saving JPEG files you can set "quality" value, from 0% to 100%. Programs like Paint don't have this option, but Photoshop and GIMP and other have. I've been doing tests, and found that for photographic images, 80% JPEG quality value produces images almost indistinguishable from lossless original, unless you start comparing pixels. But also 80% JPEG takes only ≈10% space compared to original.
@thanksfernuthin
@thanksfernuthin 7 жыл бұрын
Cool. Two decades ago I decided to use .gifs for text/title graphics and jpegs for photos/artwork just by the way they looked. And this was the reason. Nice to know.
@Nerdnumberone
@Nerdnumberone 7 жыл бұрын
Is there another image compression format that works better with sharp color changes as seen with text and similar images or does image compression in general have problems with this?
@veggiet2009
@veggiet2009 9 жыл бұрын
What if you essentially reversed the process? told the jpeg compressor to compress the low frequencies, and keep the high frequencies? What if you implemented a two pass compression system, whereby if an output image differs substantially from the original than you change the coefficients in that area and then re compress the original image? I guess I see that you've just shown that there is a way to exactly measure the quality of the output, it would seem like the compressor could use that information to produce a better overall image
@veggiet2009
@veggiet2009 9 жыл бұрын
Thank You Daniel Dawson and theguycalledchris. I can see now how reversing would be a problem. I do use PNG for most everything, but I would like to see JPEG improve to reap the benefit of a lossy compression while improving image quality. What if for the two pass compression you introduce 2 to 5 coefficient tables. Each table would be determined by the results of the 1st pass. This should, I would think, add only a little extra overhead.
@fllthdcrb
@fllthdcrb 9 жыл бұрын
veggiet2009 That's more reasonable, yeah. The tricky part will be figuring out an optimal set of tables (BTW, they're called quantization tables, because the coefficients get quantized by being scaled down; most of the compression in DCT applications comes from quantization) and maybe when to apply each one. The latter could probably be achieved by simple trial and error.
@prashantranpura7412
@prashantranpura7412 5 жыл бұрын
best practical explanation
@RD249
@RD249 6 жыл бұрын
Can we have compression by doing reverse for text. Remove low frequency and keep high frequency.
@gregorymalchuk272
@gregorymalchuk272 3 жыл бұрын
That's a really interesting concept. I wonder if or how that would work.
Optical Flow - Computerphile
8:24
Computerphile
Рет қаралды 103 М.
JPEG 'files' & Colour (JPEG Pt1)- Computerphile
7:18
Computerphile
Рет қаралды 371 М.
Comfortable 🤣 #comedy #funny
00:34
Micky Makeover
Рет қаралды 15 МЛН
If Barbie came to life! 💝
00:37
Meow-some! Reacts
Рет қаралды 47 МЛН
Идеально повторил? Хотите вторую часть?
00:13
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 16 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 50 МЛН
Cracking Enigma in 2021 - Computerphile
21:20
Computerphile
Рет қаралды 2,4 МЛН
Gambling with the Martingale Strategy - Numberphile
19:11
Numberphile
Рет қаралды 1 МЛН
Cookie Stealing - Computerphile
16:12
Computerphile
Рет қаралды 1,1 МЛН
How are Images Compressed?  [46MB ↘↘ 4.07MB] JPEG In Depth
18:47
Branch Education
Рет қаралды 3,5 МЛН
Does this sound illusion fool you?
24:55
Veritasium
Рет қаралды 285 М.
Can You Forge Tungsten?
16:14
Alec Steele
Рет қаралды 762 М.
There is No Algorithm for Truth - with Tom Scott
59:34
The Royal Institution
Рет қаралды 2,6 МЛН
A problem so hard even Google relies on Random Chance
12:06
Breaking Taps
Рет қаралды 1,1 МЛН
SHA: Secure Hashing Algorithm - Computerphile
10:21
Computerphile
Рет қаралды 1,2 МЛН
Do NOT Plug This USB In! - Hak5 Rubber Ducky
11:37
Linus Tech Tips
Рет қаралды 2 МЛН
Comfortable 🤣 #comedy #funny
00:34
Micky Makeover
Рет қаралды 15 МЛН