The Problem with JPEG - Computerphile

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 443

  • @Niosus
    @Niosus 9 років тому +462

    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 років тому +83

      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 років тому +52

      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 років тому +5

      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 років тому +2

      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 років тому +6

      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.

  • @BertGrink
    @BertGrink 9 років тому +121

    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 3 роки тому +11

      basically everything made out of lines and flat colors

    • @DripDripDrip69
      @DripDripDrip69 3 роки тому +5

      You use PNG for those things

    • @autive42
      @autive42 3 роки тому +11

      Honestly things like technical drawings and text probably are better stored in vector formats like svg or pdf.

    • @phinix250
      @phinix250 3 роки тому

      @@DripDripDrip69 I use black and white TIFF files mainly since there is often no colour info required

    • @DripDripDrip69
      @DripDripDrip69 3 роки тому

      @@phinix250 PNG can be 8 bit or 16 bit grayscale. TIFF have different compression methods, some lossless some lossy.

  • @TheBrickson98
    @TheBrickson98 8 років тому +33

    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.

  • @theblackwidower
    @theblackwidower 7 років тому +188

    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 років тому +388

    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 років тому +96

      Ah, similar to why mastering uses high bit-depth audio, then?

    •  9 років тому +59

      TazeTSchnitzel Exactly.

    • @TheMajorJF
      @TheMajorJF 9 років тому +42

      Toni Lähdekorpi And often you can fully re-expose the image in photoshop or similar if you have all the raw data.

    •  9 років тому +28

      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 років тому +24

      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.

  • @gfetco
    @gfetco 9 років тому +1190

    JPEG is the reason why some people believe in Aliens on earth.

    • @gfetco
      @gfetco 9 років тому +43

      ***** And you throw the most overwhelming fallacies I've ever heard of thus far.

    • @12togo34
      @12togo34 9 років тому +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 9 років тому +5

      And you call yourself "Enlightenment"
      change your name, or it will be changed for you.

    • @sellihoozhun
      @sellihoozhun 9 років тому +3

      +Daniel Cannata top kek

    • @fy8798
      @fy8798 8 років тому +27

      +Enlightenment
      Lots of angry Aliens Guys in the comments. Amusing.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 7 років тому +14

    The term for those artifacts is “mosquitoing”. They are the image equivalent of “ringing” in digital audio.

  • @Khaltazar
    @Khaltazar 9 років тому +119

    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 років тому +22

      Unless you are using a pointless level of compression, JPEG should always be smaller than PNG.

    • @Wildcard71
      @Wildcard71 7 років тому +8

      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 роки тому +25

      @@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 3 роки тому +6

      @@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 3 роки тому +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 UA-cam 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.

  • @xavinitram96
    @xavinitram96 9 років тому +9

    We want more videos with Mike! Those videos about graphics are just awesome!!!

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 7 років тому +4

    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.

  • @parasharkchari
    @parasharkchari 9 років тому +16

    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.

  • @TheDementation
    @TheDementation 3 роки тому +48

    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 3 роки тому +6

      Is it possible to learn this power?

    • @bluesailormercury
      @bluesailormercury 3 роки тому +3

      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 3 роки тому

      @@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 років тому +90

    Do I look like I know what a jpeg is?

    • @Fummy007
      @Fummy007 9 років тому

      Fair enough

    • @rosebuster
      @rosebuster 7 років тому +1

      No. No, you don't. :P

    • @sonicbro6446
      @sonicbro6446 3 роки тому +2

      i just wanted a picture of a damn hotdog!

    • @Yazan_Majdalawi
      @Yazan_Majdalawi 9 місяців тому

      ​@@sonicbro6446 lol

  • @LurkerPatrol
    @LurkerPatrol 3 роки тому +7

    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 3 роки тому +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 роки тому +1

      @@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 3 роки тому +5

    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 3 роки тому +1

      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.

  • @PrimeSonic
    @PrimeSonic 9 років тому +16

    I've been loving this series. I'm hoping we get to see something about PNG compression sometime.

  • @yqisq6966
    @yqisq6966 8 років тому +59

    My choice of formats are: eps for line art, png for schematic diagrams, and jpg for photographic images.

    • @ShankarSivarajan
      @ShankarSivarajan 3 роки тому +26

      .svg files are better for line art.

    • @spicybaguette7706
      @spicybaguette7706 3 роки тому +1

      @@ShankarSivarajan eps doesn't support transparency AFAIK

    • @Chxxvo
      @Chxxvo 3 роки тому +3

      .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 3 роки тому

      SVG for line art, webp for schematic diagrams, and webp for photographic images

    • @jumzbrugs9867
      @jumzbrugs9867 3 роки тому +1

      My preference:
      HEIC for nothing
      JPEG for everything else
      Oh and pdf for text 😁

  • @deeliciousplum
    @deeliciousplum 3 роки тому

    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.

  • @habdochkeineahnung
    @habdochkeineahnung 8 років тому +3

    that dude changed for good. i havent seen the old videos for a while.

  • @Soundole
    @Soundole 9 років тому +13

    I've found this series about JPEG compression extremely fascinating and enlightening - thanks for putting them together!

  • @numan6693
    @numan6693 6 місяців тому

    After 8 years. Still one of the best Videos to JPEG Compression

  • @koustavbhattacharyya
    @koustavbhattacharyya 9 років тому +2

    This series is awesome !! MOAR of this please !!

  • @Knigh7z
    @Knigh7z 9 років тому +7

    1:41, are the 51s and 55s supposed to be 151s and 155s? just caught my eye lol

    • @seanski44
      @seanski44 9 років тому +5

      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

  • @power-max
    @power-max 9 років тому +5

    +Computerphile Could you do a video discussing techniques for interpolation in general, covering the different methods and algorithms used to accomplish it?

  • @Sweetw4ter
    @Sweetw4ter 9 років тому +2

    Mike Pound is awesome, more of him please!

  • @XxHRITxX
    @XxHRITxX 4 місяці тому +1

    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!

  • @MichaelJE2
    @MichaelJE2 9 років тому +1

    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.

  • @eliastandel
    @eliastandel 8 років тому +4

    Is it possible to make a different quantization table for text-heavy images that minimizes these artifacts?

    • @djmips
      @djmips 8 років тому +3

      yes.

    • @roderik1990
      @roderik1990 7 років тому +1

      Theoretically yes, but said quantization table might not be as generally applicable.

    • @LudwigvanBeethoven2
      @LudwigvanBeethoven2 5 років тому +1

      Or you could just use png for that kind of image

  • @drugmonster6743
    @drugmonster6743 9 років тому +3

    This guy is great, more of him!
    Do WebP next.

  • @tankermottind
    @tankermottind 9 років тому +6

    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 років тому +1

      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).

  • @GimliTehDwarf
    @GimliTehDwarf 8 років тому +10

    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!

  • @danmanx2
    @danmanx2 3 роки тому +20

    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 3 роки тому +7

      Why is the sink at my door again?

    • @VenetinOfficial
      @VenetinOfficial 3 роки тому +2

      @@lemonke8132 You gotta let it in bro. Let that sink in…

    • @Gogglesofkrome
      @Gogglesofkrome 3 роки тому +1

      @@VenetinOfficial this is starting to go down the drain

    • @Triantalex
      @Triantalex Місяць тому

      ok?

  • @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.

  • @smegskull
    @smegskull 9 років тому +3

    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 років тому +3

      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 років тому +7

      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 років тому +8

      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.

  • @ChristianAkacro
    @ChristianAkacro 9 років тому +4

    That was great! Those artefacts have always driven me nuts, and now I know why!

  • @maximiliandc2
    @maximiliandc2 9 років тому +1

    Please do a series on mp3 or other audio compression methods!

  • @narrowkeel
    @narrowkeel 9 років тому +1

    This is probably my favorite channel on youtube.

  • @marcfuchs6938
    @marcfuchs6938 3 роки тому +1

    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.

  • @yashbutno
    @yashbutno 3 роки тому +1

    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.

  • @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?

  • @DaveMakes
    @DaveMakes 9 років тому +1

    fantastic video series, thanks very much for making it.

  • @MrTridac
    @MrTridac 9 років тому +1

    I like this series. More from Mike, please.

  • @RajinderYadav
    @RajinderYadav 3 роки тому +2

    I never use jpeg, switched to PNG and really happy with the quality. My camera, like most does use jpeg compression, but I also have RAW which can be compressed later, so RAW is the way to go.

    • @markoposavec9240
      @markoposavec9240 2 роки тому

      True if you are serious about photography you really should shoot RAW, the ability to change image processing parameters after capture is to valuable to pass. Even considering the logistical problems with RAW.

  • @rich1051414
    @rich1051414 6 місяців тому

    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.

  • @isaacc7
    @isaacc7 9 років тому +1

    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...

  • @JimPfaff
    @JimPfaff 3 роки тому

    You should link the video which describes the 300dpi problem as a comparison to this one. The concepts are quite similar.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 7 років тому +1

    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.

  • @ViktorEngelmann
    @ViktorEngelmann 5 років тому

    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...

  • @rkpetry
    @rkpetry 7 років тому +2

    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....

  • @1eikaramba1
    @1eikaramba1 9 років тому +2

    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)

  • @xanokothe
    @xanokothe 9 років тому +2

    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 років тому +3

      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 років тому +1

      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 років тому +1

      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

  • @NeoTechni
    @NeoTechni 3 роки тому +7

    It sounds like JPEG should have been built to detect these high-frequency blocks and just give up and leave them uncompressed

    • @Gogglesofkrome
      @Gogglesofkrome 3 роки тому +1

      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 3 роки тому

      @@Gogglesofkrome that would also work

  • @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?

  • @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").

  • @deathstroyer
    @deathstroyer Рік тому +2

    jpeg was made specifically for photographs, for other images png is superior as it has powerful lossless compression.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 7 років тому

    1:00 “High frequencies” i.e. image-processing-speak for “sharp edges”.

  • @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?

  • @rogerdinhelm4671
    @rogerdinhelm4671 8 років тому +33

    Please, make a video about JPEG2000, it is largely unknown but interesting technology.

    • @glennzone12
      @glennzone12 8 років тому +10

      And a video about webP

  • @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

  • @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?

  • @soraaoixxthebluesky
    @soraaoixxthebluesky 7 років тому +4

    I trying to avoid using jpeg but my storage was like "no. don't you ever try to think about it"

  • @homeycdawg
    @homeycdawg 9 років тому +6

    Seems to me that jpeg is best for fast loading pictures on web pages.

  • @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 9 років тому +1

      +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. :)

  • @faissalbensefia7001
    @faissalbensefia7001 9 років тому +169

    This is why I use PNG

    • @BeatleFloydZeppelin
      @BeatleFloydZeppelin 9 років тому +51

      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 років тому +10

      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 років тому +14

      *****
      Not sure if sarcasm
      ﺟ_ﺟ
      or serious

    • @erikziak1249
      @erikziak1249 9 років тому

      Faissal Bensefia for screenshots

    • @bayraktarx1386
      @bayraktarx1386 9 років тому +3

      Faissal Bensefia if you have so much text just put it in text document, or use JPEG in normal resolution.

  • @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.

  • @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?

  • @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??

  • @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 років тому +4

      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.

  • @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.

  • @teslastellar
    @teslastellar 4 роки тому +6

    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.

  • @TonyP9279
    @TonyP9279 9 років тому

    I wonder what format New Horizons used for the Pluto images?

  • @DanielJohnNicholson
    @DanielJohnNicholson 8 років тому +85

    The best way to fix this problem is to use PNG

  • @DFX2KX
    @DFX2KX 9 років тому

    JEPEG also has that artifacting when scanning drawings, worse if you drew with ink or a darker lead.

  • @veggiet2009
    @veggiet2009 9 років тому +1

    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.

  • @FloydMaxwell
    @FloydMaxwell 3 роки тому

    would have been nice to see a comparison with SVG & PNG

  • @lejink
    @lejink 9 років тому +126

    So what you're saying is my porn could be in much higher quality?

    • @hristaki99
      @hristaki99 9 років тому +147

      Dee Jay Only if it's interracial.

    • @macronencer
      @macronencer 9 років тому +18

      hristaki99 Hahaha! You win today's Internet.

    • @SuviTuuliAllan
      @SuviTuuliAllan 9 років тому +4

      hristaki99 Not sure if racist or awesome. -.-

    • @Watupm
      @Watupm 9 років тому +4

      hristaki99 rofl I cried laughing so hard

    • @hristaki99
      @hristaki99 9 років тому +9

      Suvi-Tuuli Allan In the video he explained that artifacts are caused by sharp change in colour between pixels. nuff said

  • @mountp1391
    @mountp1391 3 роки тому

    This video is so helpful regarding ICT fundamental principle.

  • @aquarius5719
    @aquarius5719 3 роки тому

    Where can I learn about coding to make JPEG or BMP images?

  • @therollingjonicle
    @therollingjonicle 10 місяців тому

    This is so great! Thank you very much for making these videos!

  • @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 років тому +4

      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.

  • @magdabrownis265
    @magdabrownis265 3 роки тому

    James Rolfe from Cinemassacre and Ian Ferguson from CUPodcast had a British baby and it’s this guy

  • @centerfield6339
    @centerfield6339 3 роки тому

    In the interest of global bandwidth reduction, it may be worth changing our alphabet to include surrounding JPEG artefacts in its letters. Thoughts?

  • @volundrfrey896
    @volundrfrey896 9 років тому +1

    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.

  • @thudso
    @thudso 6 років тому

    Can you do videos on vector graphics at some point? These were awesome.

  • @Hades948
    @Hades948 8 років тому +2

    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 8 років тому

      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.

  • @frustbox
    @frustbox 9 років тому +33

    »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 років тому +10

      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 років тому +1

      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 років тому +2

      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.

  • @davidjames1684
    @davidjames1684 4 роки тому

    If the image has small text in it, just use the mildest JPG compression setting. What is the big deal? It works fine.

  • @RD249
    @RD249 7 років тому

    Can we have compression by doing reverse for text. Remove low frequency and keep high frequency.

    • @gregorymalchuk272
      @gregorymalchuk272 4 роки тому

      That's a really interesting concept. I wonder if or how that would work.

  • @Roshkin
    @Roshkin 9 років тому

    For text, why not invert it and assume no low frequency and only high?

  • @imedman1
    @imedman1 9 років тому +1

    You should make a video about MPEG!

  • @VenetinOfficial
    @VenetinOfficial 3 роки тому

    Is jpeg noise just the image equivalent of the nyquist limit

  • @helloitismetomato
    @helloitismetomato 3 роки тому

    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.)

  • @NormReitzel
    @NormReitzel 3 роки тому

    Very interesting. I never knew that jpeg does to visual data the same thing "telephone" codecs do to voice.

  • @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.

  • @ShiroKage009
    @ShiroKage009 9 років тому +3

    "Lots of people swear by swearing in raw," like yours truly :P

  • @narayanbhat3279
    @narayanbhat3279 5 років тому +1

    How to get those values?

  • @tehguitarque
    @tehguitarque 8 років тому

    Render text from source... Yikes how many cores does that take?

  • @MatthewSchraderCG
    @MatthewSchraderCG 2 місяці тому

    I actually created a Python script that uses OCR to detect text and create a kind of mask for relevant blocks. It then saves this mask out at a separate compression than the rest of the image. Not sure why users don't at least have an option for this in 2024 now. Obviously lossless exists but yknow.

  • @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.

  • @danbrit9848
    @danbrit9848 3 роки тому

    So I use mc paint for my art and it was driving me insain that for the last few years if I had text I had one save because of the artifacts messing with it after was impossible...now I know why ...thank you so much

    • @cowboybob7093
      @cowboybob7093 3 роки тому

      It's crushing to change a background color and find the text is surrounded by negligibly different pixel fur. One (imperfect) approach is to reduce the colors, even to monochrome.