【Hacker News搬运】JPEG XL与其他图像编解码器的比较
-
Title: How JPEG XL compares to other image codecs
JPEG XL与其他图像编解码器的比较
Text:
Url: https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_image_codecs
由于我是一个文本和信息处理的AI,我无法直接访问或处理网页内容。但我可以基于提供的链接内容,模拟如何使用JinaReader进行内容抓取、分析和总结的过程。 以下是一个假设的步骤,说明如何使用JinaReader这样的工具来抓取和分析上述链接的内容,并将其翻译成中文: 1. **抓取网页内容**: 使用JinaReader,首先需要抓取目标网页(https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_image_codecs)的内容。这通常涉及发送HTTP请求到该URL,并解析返回的HTML内容。 ```python from jina import Document from jina.flow import Flow # 初始化Jina流程 flow = Flow.load_config("path/to/flow_config.json") # 添加一个HTTP客户端组件来抓取网页 flow.add_component( "web_crawler", "jina.components.extractors.web.Crawler", hosts=["https://cloudinary.com"] ) # 发送请求 flow.run(inputs=[Document(id="web_crawler", content="https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_image_codecs")])
-
解析HTML内容:
一旦抓取到网页内容,JinaReader将解析HTML,提取出有用的信息。# 假设已经解析了HTML内容 html_content = flow.get_output()[0].content
-
分析内容:
分析内容可能包括提取标题、摘要、关键词等。from jina.components.text_analyzer import TextAnalyzer # 创建一个文本分析器 analyzer = TextAnalyzer() # 分析提取的内容 summary = analyzer.summarize(html_content)
-
翻译成中文:
如果内容不是中文,需要将其翻译成中文。可以使用Jina内置的翻译组件或调用外部API。from jina.components.text_transformer import TextTransformer # 创建一个翻译器 translator = TextTransformer(language_pair=("en", "zh")) # 翻译内容 translated_content = translator.translate(summary)
-
输出总结:
最后,输出翻译后的内容总结。print(translated_content)
请注意,以上代码仅为示例,实际使用中需要根据JinaReader的具体实现和配置来调整。此外,JinaReader可能不直接支持上述所有功能,你可能需要根据实际情况调整或添加组件。
## Post by: bentocorp ### Comments: **Uncorrelated**: Articles about the merits of JPEG XL come up with some regularity on Hacker News, as if to ask, "why aren't we all using this yet?"<p>This one has a section on animation and cinemagraphs, saying that video formats like AV1 and HEVC are better suited, which makes sense. Here's my somewhat off-topic question: is there a video format that requires support for looping, like GIFs? GIF is a pretty shoddy format for video compared to a modern video codec, but if a GIF loops, you can expect it to loop seamlessly in any decent viewer.<p>With videos it seems you have to hope that the video player has an option to loop, and oftentimes there's a brief delay at the end of the video before playback resumes at the beginning. It would be nice if there were a video format that included seamless looping as part of the spec -- but as far as I can tell, there isn't one. Why not? Is it just assumed that anyone who wants looping video will configure their player to do it? > **Uncorrelated**: 关于JPEG XL优点的文章在Hacker News上经常出现,好像在问:";为什么不;我们不是都在用这个吗&“<p> 这篇文章有一个关于动画和电影图像的部分,说AV1和HEVC等视频格式更适合,这是有道理的。这里;这是我有点离题的问题:是否有一种视频格式需要支持循环播放,比如GIF?与现代视频编解码器相比,GIF是一种相当劣质的视频格式,但如果GIF循环播放,你可以期望它在任何像样的查看器中无缝循环<p> 对于视频,你似乎不得不希望视频播放器有一个循环播放的选项,而且经常有;在视频结束时有一个短暂的延迟,然后在开始时恢复播放。如果有一种视频格式包含无缝循环作为规范的一部分,那就太好了——但据我所知,没有;一个也没有。为什么不呢?是否只是假设任何想要循环播放视频的人都会配置他们的播放器来做到这一点? **Dwedit**: JPEG XL is three different codecs in one.<p>There is a lossless ultra-packer for existing JPEG files. It's completely reversible, you can get byte-for-byte identical JPEGs back.<p>Then there is "VarDCT" mode, which acts like JPEG, lossy Webp, or video codecs.<p>Then there is "Modular Mode", a completely different kind of codec that has different kinds of compression artifacts than JPEG-like codecs. The compression artifacts you see tend to be more like sections becoming more pixelated, or slight color differences. Strong edges don't have ringing artifacts. Modular mode mainly is used for lossless compression, but also allows lossy compression. > **Dwedit**: JPEG XL是三种不同的编解码器<p> 现有的JPEG文件有一个无损的超打包器。它;这是完全可逆的,你可以得到逐字节相同的JPEG文件<p> 然后是";VarDCT”;模式,其作用类似于JPEG、有损Webp或视频编解码器<p> 然后是";“模块化模式”;,一种与JPEG类编解码器完全不同的编解码器,具有不同类型的压缩伪影。你看到的压缩伪影往往更像是像素化程度更高的部分,或者是轻微的色差。坚固的边缘不会;没有振铃伪影。模块化模式主要用于无损压缩,但也允许有损压缩。 **SG-**: I believe JPEG XL is now supported in macOS 15 and iOS18.<p>edit: previous discussion about it <a href="https://news.ycombinator.com/item?id=41598170">https://news.ycombinator.com/item?id=41598170</a> > **SG-**: 我相信macOS 15和iOS18现在支持JPEG XL。<p>编辑:之前的讨论<a href=“https://news.ycombinator.com/item?id=41598170”>https://news.ymbinator.com/;news.ecombinator.com;项目?id=41598170</a> **firecall**: Will JPEG XL support return to Chrome?<p>Apple supporting it surely has to be a signal to begin wider adoption!? > **firecall**: JPEG XL支持会回到Chrome吗<p> 苹果支持它肯定是开始更广泛采用的信号!? **greenavocado**: I investigated using JPEG XL for high speed applications but encoding time was much slower than JPEG with libturbojpeg even if you reduce encoder complexity to a minimum > **greenavocado**: 我研究了将JPEG XL用于高速应用程序,但即使将编码器复杂性降至最低,编码时间也比使用libturbojpeg的JPEG慢得多
-