TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Visualizing and Understanding JPEG Format

215 pointsby yasoobalmost 5 years ago

17 comments

andrewgleavealmost 5 years ago
Check out Unraveling the JPEG from Omar Shehata on Parametric Press[1] for an interactive essay on the JPEG format.<p>Very cool to be able to manipulate the bytes directly and seeing how it affects the image.<p>[1] <a href="https:&#x2F;&#x2F;parametric.press&#x2F;issue-01&#x2F;unraveling-the-jpeg&#x2F;" rel="nofollow">https:&#x2F;&#x2F;parametric.press&#x2F;issue-01&#x2F;unraveling-the-jpeg&#x2F;</a>
BlackLotus89almost 5 years ago
Hexfiend (open source hex editor for mac) [0] and synalize it [1] (closed source hex editor for mac) both support a similar feature (hexfiend only in the newest github release) that shows the structure of known file formats similar to what wireshark [2] does for network packages.<p>Thought about writing an hex editor or adding the hex fiend functionality to other hex editors based on the templates of hex fiend.<p>[0] <a href="http:&#x2F;&#x2F;ridiculousfish.com&#x2F;hexfiend&#x2F;" rel="nofollow">http:&#x2F;&#x2F;ridiculousfish.com&#x2F;hexfiend&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;www.synalysis.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.synalysis.net&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;www.wireshark.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.wireshark.org&#x2F;</a>
评论 #23792187 未加载
yasoobalmost 5 years ago
This repo from the author is full of gold. Shows the details and visualization of various file structures (including multiple zip formats, image formats and executable files)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;corkami&#x2F;pics" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;corkami&#x2F;pics</a>
评论 #23789140 未加载
ache7almost 5 years ago
By the way, you can decode JPEG with less artifacts using these projects:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ilyakurdyukov&#x2F;jpeg-quantsmooth" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ilyakurdyukov&#x2F;jpeg-quantsmooth</a> (good for most mid-quality and high-quality images)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;victorvde&#x2F;jpeg2png" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;victorvde&#x2F;jpeg2png</a> (use for very low-quality images, slower)<p>jpeg-quantsmooth gives a sharper output (use &quot;-q6&quot; option).<p>jpeg2png output is a little blurry, but it does a better job of unblocking very low-quality images.
评论 #23789980 未加载
userbinatoralmost 5 years ago
If you&#x27;re looking for a fun project that can be completed in a weekend or less, one of the things I recommend is to write a (baseline) JPEG decoder. The official spec (linked from the article near the top) is quite readable as far as standards go, and even contains helpful flowcharts for basically the whole process. When I did it, it took less than 1kLoC of C, including some minor optimisations like array-based Huffman decoding (although the version in the spec is quite compact, it is slower --- but still not as slow as the &quot;theoretical&quot; bit-by-bit tree-traversal that a lot of other tutorials on Huffman show.)<p>H.261 (a video format) is roughly of the same if not slightly less complexity, and also makes a good weekend project.
评论 #23792676 未加载
xchipalmost 5 years ago
I wish I had had this when I wrote my 250 LOC jpeg visualizer!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;aguaviva&#x2F;micro-jpeg-visualizer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aguaviva&#x2F;micro-jpeg-visualizer</a>
UglyToadalmost 5 years ago
This is great, I was literally banging my head against a wall last night trying to determine how the length of the ECS was determined. What a lucky coincidence!<p>I&#x27;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.
gruturoalmost 5 years ago
Very nice read, thanks for posting it!!!<p>I also learned a lot from the various JPEG articles on ImpulseAdventure (no affiliation), e.g.:<p><a href="https:&#x2F;&#x2F;www.impulseadventure.com&#x2F;photo&#x2F;jpeg-quantization.html" rel="nofollow">https:&#x2F;&#x2F;www.impulseadventure.com&#x2F;photo&#x2F;jpeg-quantization.htm...</a><p><a href="https:&#x2F;&#x2F;www.impulseadventure.com&#x2F;photo&#x2F;jpeg-compression.html" rel="nofollow">https:&#x2F;&#x2F;www.impulseadventure.com&#x2F;photo&#x2F;jpeg-compression.html</a><p><a href="https:&#x2F;&#x2F;www.impulseadventure.com&#x2F;photo&#x2F;chroma-subsampling.html" rel="nofollow">https:&#x2F;&#x2F;www.impulseadventure.com&#x2F;photo&#x2F;chroma-subsampling.ht...</a><p>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.
ChrisMarshallNYalmost 5 years ago
This is great!<p>The model used by JPEG is not that unusual in image processing, so this can help us to understand many types of processes.<p>This person has a whole bunch of this stuff! Gold!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;corkami" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;corkami</a>
donatjalmost 5 years ago
They could also note how 3D MPO images work, they’re just two jpegs concatenated together with some special markers. It’s been a while but I’ve written MPO parsers for a couple languages.
0-_-0almost 5 years ago
I have a question in case someone knows:<p>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?
numlock86almost 5 years ago
&gt; lossless storage:<p>&gt; 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).<p>Interesting. I wonder if this is used internally in any applications.
评论 #23789615 未加载
评论 #23788836 未加载
the_dripperalmost 5 years ago
If I&#x27;m being honest, I&#x27;m more of a PNG fan.
评论 #23789988 未加载
tinkertamperalmost 5 years ago
Where’s all the Hard G “Jerraffic” folks in this thread fighting for the pronunciation [JAY-feg]?
busterarmalmost 5 years ago
When you know it&#x27;s going to be Corkami before you even click... :D
fasfsafsaalmost 5 years ago
why i still see jpeg in 2020 ?
评论 #23789973 未加载
评论 #23789653 未加载
评论 #23789715 未加载
评论 #23789611 未加载
评论 #23789239 未加载
ebg13almost 5 years ago
&gt; <i>JAY-peg</i><p>I think they mean JAY-pheg.