Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image: jpg / webp / avif / jxl #170

Open
magicdawn opened this issue Dec 16, 2023 · 3 comments
Open

image: jpg / webp / avif / jxl #170

magicdawn opened this issue Dec 16, 2023 · 3 comments

Comments

@magicdawn
Copy link
Owner

No description provided.

@magicdawn
Copy link
Owner Author

magicdawn commented Dec 16, 2023

评测

https://tsev.dev/posts/2023-11-10-should-avif-be-the-dominant-image-format/

结论

  • 视觉上无损: perceptually lossless, loss of detail (e.g. a wood texture turned into a solid colour), or loss of features (e.g. hair strands or tree branches turned into a blur) to denote perceptual loss.

  • 对于 AVIF,在质量设置为 60% 时,准确度实际上会陷入停滞,同时会快速赶上与 JPEG 类似的文件大小。在 70% 时,AVIF 和 JPEG 的感知准确度几乎无法区分,文件大小也趋于一致。 80% 之后,AVIF 文件大小的膨胀速度比其他格式快得多,但感知准确性却没有提高。

  • 质量设置为 70% 的 AVIF 与 90% 的 WebP 和 JPEG 的(算法)准确度大致相同,但(文件大小)明显小于 WebP 和 JPEG!

  • AVIF 在质量设置为 60-70% 时始终准确,JPEG 为 80%,WebP 为 90%


personal suggestion for quality settings:

  • 85% for jpeg(mozjpeg)
  • 70% for avif
  • webp 按上面结论要 90%+, 但是这个时候文件就会很大, 于是不推荐

@magicdawn
Copy link
Owner Author

exif 信息

exifr 的 option
image

GPT-3.5 不知道准确性

@magicdawn magicdawn changed the title image: webp / avif / jxl image: jpg / webp / avif / jxl Mar 29, 2024
@magicdawn
Copy link
Owner Author

magicdawn commented Mar 29, 2024

jpeg

jpeg 文件格式

// JPG contains SOI, APP1, [APP2, ... APPn], DQT, DHT, and more segments
// APPn contain metadata about the image in various formats. There can be multiple APPn segments,
// even multiple segments of the same type.
// APP1 contains the basic and most important EXIF data.
// APP2 contains ICC
// APP13 contains IPTC

exif (APP1段, id 为 Exif)

实例

image

  • FF D8: SOI = Start of Image
  • FF E1: APP1
  • 97 F9: 段大小
  • 45 78 69 66: Exif 字符串

tiff

// Structure of TIFF (APP1-EXIF):
// - FF E1 - marker
// - xx xx - Size
// - 45 78 69 66 00 00 / ASCII string 'Exif\0\0'
// - TIFF HEADER
// - 0th IFD + value
// - 1th IFD + value
// - may contain additional GPS, Interop, SubExif blocks (pointed to from IFD0)

When Exif is employed for JPEG files, the Exif data are stored in one of JPEG's defined utility Application Segments, the APP1 (segment marker 0xFFE1), which in effect holds an entire TIFF file within. When Exif is employed in TIFF files (also when used as "an embedded TIFF file" mentioned earlier), the TIFF Private Tag 0x8769 defines a sub-Image File Directory (IFD) that holds the Exif specified TIFF Tags. In addition, Exif also defines a Global Positioning System sub-IFD using the TIFF Private Tag 0x8825, holding location information, and an "Interoperability IFD" specified within the Exif sub-IFD, using the Exif tag 0xA005.

实际来看, jpeg APP1-exif 段包含一个完整 tiff 文件.

TIFF HEADER

export const TIFF_LITTLE_ENDIAN = 0x4949
export const TIFF_BIG_ENDIAN    = 0x4D4D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant