Visualizing and Understanding JPEG Format
github.com
github.com
Very cool to be able to manipulate the bytes directly and seeing how it affects the image.
Thought about writing an hex editor or adding the hex fiend functionality to other hex editors based on the templates of hex fiend.
[0] http://ridiculousfish.com/hexfiend/
> Wireshark is the world’s foremost and widely-used network protocol analyzer. It lets you see what’s happening on your network at a microscopic level and is the de facto (and often de jure) standard across many commercial and non-profit enterprises, government agencies, and educational institutions.
From the website. Btw wireshark is is one of the most useful tools for system administrators (especially in combination with tcpdump and ssh) and giving up on a project, because your browser bugs out is kind of bad form. You should at least take a look at it. Anyway hope you change your mind and have fun ;) some of my most interesting nights I have spent with wireshark
It's much more a critique of the state of the web than of the project itself.
BTW, both behaviors (insane CPU usage while scrolling and Cloudflare checking) are reproducible in Safari, Chrome and Firefox, so it's not the browser that's bugging out, but the website scroll highjacking that's poorly written.
https://media.ccc.de/search?p=Ange+Albertini
The Preserve Arcade Games talk is also good, I only realized now that both talks were by the same person.
https://github.com/ilyakurdyukov/jpeg-quantsmooth (good for most mid-quality and high-quality images)
https://github.com/victorvde/jpeg2png (use for very low-quality images, slower)
jpeg-quantsmooth gives a sharper output (use "-q6" option).
jpeg2png output is a little blurry, but it does a better job of unblocking very low-quality images.
Another algorithm that should work but I haven't seen tried is edge-aware chroma upsampling. libjpeg uses nearest neighbor upscaling for the subsampled color planes, which is why JPEG looks so bad when there's a transition from eg saturated red to black.
I'm suggesting something like eedi3 (http://avisynth.nl/index.php/Eedi3) but guided by the luma plane.
Oh, you can also jointly optimize the YUV-RGB conversion because if the pixel ends up out of range in RGB space it is probably a compression artifact. I read a paper on this once but haven't seen it implemented.
Well, I meant better upsampling than bilinear interpolation, which blurs chroma.
"Oh, you can also jointly optimize the YUV-RGB conversion because if the pixel ends up out of range in RGB space it is probably a compression artifact."
Probably not, I suspect that the mozjpeg encoder may use this, so images with black on white text look better (artifact noise go beyond of range).
H.261 (a video format) is roughly of the same if not slightly less complexity, and also makes a good weekend project.
I'm trying to build a small C# library to support reading image types to learn about them, png was quite understandable but jpg is a little trickier, given I panic when I see maths.
I also learned a lot from the various JPEG articles on ImpulseAdventure (no affiliation), e.g.:
https://www.impulseadventure.com/photo/jpeg-quantization.htm...
https://www.impulseadventure.com/photo/jpeg-compression.html
https://www.impulseadventure.com/photo/chroma-subsampling.ht...
They also have a lot of practical stuff (which chroma subsampling will Photoshop actually use when you save at 80% quality?) in addition to the theory.
The model used by JPEG is not that unusual in image processing, so this can help us to understand many types of processes.
This person has a whole bunch of this stuff! Gold!
If I wanted to develop a custom JPEG decoder, what would be the easiest way to get image data from a jpeg file into Tensorflow (or numpy, Pytorch, etc.) tensors? I mean the raw DCT coefficients, and the coefficient table?
> to make JPEG store data losslessly: use grayscale, 100% quality, then either width or eight to 1 pixel, or duplicate the padded data 8 times (JPEG images are stored in 8x8 blocks).
Interesting. I wonder if this is used internally in any applications.
2 - JPEG algorithm allows to have lossless data without padding
3 - For lossless data rar/arc/ace are better then JPEG
Internally, JPEG has the key techniques required to compress photos well, and nothing else. Most newer formats are based on the same principles, except each bit is upgraded to the point of diminishing returns.
HEIF and AVIF compress twice as well as JPEG, but in terms of complexity and computational requirements are hundreds of times more complex.
The economics of the camera market right now will make adoption of new formats (and the additional/more expensive hardware in the camera to support it) slow and jpeg is a very reasonable format for photographers to shoot when they don't want/need to shoot raw.
Also, some of the alternative formats have licensing or patent issues that would effectively block wide adoption.
BPG isn't supported by any browsers.
WEBP isn't supported by IE11 or Safari.
Though there are other lossful encoding schemes developed since that either produce better results with the same data size or comparable results with better compression (or both). But the improvements have not been large enough to make the industry as a whole consider making the effort to support these other formats (and in some cases there would be licensing/patent issues making support legally/financially onerous on top of the coding/testing required).
It's not a good idea to enable too many file formats in a browser because of the new security issues, so it really needs to be a huge improvement. I also think WebP was a mistake for this reason, it's not good enough.
From "JPEG 2000: The Better Alternative to JPEG That Never Made it Big": https://petapixel.com/2015/09/12/jpeg-2000-the-better-altern...
JPEG 2000 is a much better image solution than the original JPEG file format. Using a sophisticated encoding method, JPEG 2000 files can compress files with less loss of, what we might consider, visual performance. In addition, the file format is less likely to be affected by ‘bit errors’ and other file system errors due to its more efficient coding structure.
Those who choose to save their files in the JPEG 2000 standard can also choose between utilizing compression or saving the file as lossless to retain original detail. A higher dynamic range is also supported by the format with no limit of an image’s bit depth. Together, these abilities created a much better alternative than the original JPEG solution.
This is confusing. I think they mean that a file is less likely to be corrupt if it's smaller, which is debatable. But I wouldn't use a newer codec just to make smaller files, I'd make them higher quality at the same size. In that case you need redundancy, which is the opposite of compression efficiency.
> A higher dynamic range is also supported by the format with no limit of an image’s bit depth.
JPEG supports this, but most decoders don't because pixel depth is not something you can just abstract away. Do JPEG2K decoders actually support 10/12-bit? HEIF does.
BTW compression efficiency is orthogonal not opposite of structured redundancy that you would want. As a thought experiment, imagine as a last step of coding, encrypting the data with a publicly known key. Theoretical redundancy remains the same, but good luck¹ getting your data back, if you get a bit error.
¹ Imagine a variable length single block cypher was used, multi round CBC or something.
I think they mean JAY-pheg.