SDWebImage / SDWebImage/SDWebImageWebPCoder

Low compression quality compared to cwebp CLI tool

Đang mở
#116 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Objective-C
Star
277
Fork
101
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Description

When using SDImageWebPCoder to encode images with lossless options, the resulting file size and compression quality appear to be worse compared to Google's cwebp command-line tool. Despite both using lossless compression settings, SDImageWebPCoder produces slightly lower quality images, with visible artifacts and banding on gradients and shadows.

I experimented with different encoding options such as: encodeCompressionQuality, encodeWebPMethod, encodeWebPPass etc. Despite these adjustments, the output quality and file size were still worse compared to cwebp -lossless. This suggests a fundamental difference in how the WebP encoding is implemented in SDImageWebPCoder versus the official WebP compression tool.

Code

SDImageWebPCoder:

if let data = SDImageWebPCoder.shared.encodedData(with: nsImage, format: .webP, options: [.encodeWebPLossless: 1]) {
  try data.write(to: destination))
}

cwebp:

cwebp -lossless input.png -o output.webp
Results

Image

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với điểm đầu vào mã hóa không mất dữ liệu của SDImageWebPCoder được nêu trong báo cáo và so sánh đầu ra của nó với cwebp -lossless bằng ví dụ được cung cấp. Kiểm tra các tùy chọn encodeCompressionQuality, encodeWebPMethod và encodeWebPPass nào được chuyển tiếp, sau đó xác định là hoàn tất khi hành vi về chất lượng không mất dữ liệu và kích thước tệp khớp với cwebp hoặc khi khác biệt trong triển khai được ghi lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
objective-c, swift
Lĩnh vực
computer-graphics
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.