Live data from Hacker News

Visualizing and Understanding JPEG Format

github.com

31–40 of 47 posts

Re: Visualizing and Understanding JPEG Format

#31
post #29

Earlier quoted context omitted.

The question you should be asking is 'why I still see animated gifs in 2020?'

Do you? I thought many ‘animated GIFs’ aren’t GIF files anymore. Twitter, for example, serves MP4 files ( https://techcrunch.com/2014/06/19/gasp-twitter-gifs-arent-ac... )

As well as the compression, I think this also had a lot to do with native mobile app support, where MPEG4 was far easier to deal with than animated GIFs.

Re: Visualizing and Understanding JPEG Format

#32
I have a question in case someone knows:

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?

Re: Visualizing and Understanding JPEG Format

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

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/

[1] https://www.synalysis.net/

[2] https://www.wireshark.org/

Re: Visualizing and Understanding JPEG Format

#35
post #22

why i still see jpeg in 2020 ?

It works incredibly well for a format its age. It's simple, and widely supported. 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 mo…

Also, in addition to what you mentioned, we have jpegs because photographers are still shooting jpegs with their cameras.

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.

Re: Visualizing and Understanding JPEG Format

#37
If you'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 "theoretical" bit-by-bit tree-traversal that a lot of other tutorials on Huffman show.)

H.261 (a video format) is roughly of the same if not slightly less complexity, and also makes a good weekend project.

Re: Visualizing and Understanding JPEG Format

#39

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. Thought about writing an hex editor or adding the hex fiend functionality to other hex editors based on the templates of hex fiend. [0] htt…

I love Hexfiend, so I was checking wireshark.org to see what you meant, since I don't use it nearly as much. First, Cloudshare is evaluating my browser to see if it's genuine access. Why? Second, scrolling the site uses 97% of my CPU. WTF is it doing? Some parallax effect on the shark, that could easily be done with a few lines of CSS? Lost interest at the spot. What have we turned the web into.

Re: Visualizing and Understanding JPEG Format

#40

If you'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 Huffm…

Where do you get the spec for video? That really something that can be done in a weekend?
Post reply on HN