Skip to content
DreamPiggy edited this page Feb 28, 2024 · 27 revisions

Coder Plugin

SDWebImage supports custom image coder plugin. Which can easily extern image format support when using SDWebImage's core feature.

Our core lib, only use the Apple System build-in codec. Which support the common image format, like JPEG/PNG/GIF/BMP/HEIF. But you can use any of your preferred image formats by using the correct image coder plugins.

You can check some public coder plugin here for image format which is not available from SDWebImage's core repo. See Custom Coder for more detailed usage.

SDWebImage organization maintained

Format Repo Format Code Decode Encode Animation Progressive Thumbnail
WebP SDWebImageWebPCoder .webP Y Y Y Y Y (from v0.4.0)
APNG SDWebImageAPNGCoder (Deprecated, 5.x built-in plugin) .PNG Y Y Y Y N
GIF SDWebImageFLPlugin (Deprecated, use FLAnimatedImage) .GIF Y Y N N N
HEIF SDWebImageHEIFCoder .HEIF Y Y N N Y (from v0.7.0)
BPG SDWebImageBPGCoder .BPG = 11 Y Y (from v0.4) Y N N
SVG-Native SDWebImageSVGNativeCoder .SVG Y N N N Y (Bitmap)
SVG SDWebImageSVGCoder .SVG Y Y N N Y (Vector from v1.4.0)
SVG SDWebImageSVGKitPlugin (Deprecated, use SVGKit) .SVG Y Y N N Y (Vector from v1.1.0)
PDF SDWebImagePDFCoder .PDF Y Y (from v0.3) N N Y (Vector from v0.6.0)
FLIF SDWebImageFLIFCoder .FLIF = 14 Y Y Y Y N
AVIF SDWebImageAVIFCoder .AVIF = 15 Y Y (from v0.2) Y (from v0.9.0) N N
Lottie SDWebImageLottieCoder .lottie = 16 Y N Y N Y (Bitmap)
Lottie SDWebImageLottiePlugin .lottie = 16 Y N Y N N (Vector)
JPEG-XL SDWebImageJPEGXLCoder .jpegxl = 17 Y N Y N YES

Community contribution (Welcome !)

Format Repo Format Code Decode Encode Animation Vector

For Coder Plugin Developers

If your custom coder add new image format support, which is not listed in SDWebImage built-in define of SDImageFormat, you can define it and update the format code here. To avoid the format code conflict with others. The custom minimum format code should be larger than 10, to keep future reserved format used by SDWebImage core repo.

  • Objective-C
static const SDImageFormat SDImageFormatBPG = 11;
  • Swift
extension SDImageFormat {
    public static let BPG: SDImageFormat = SDImageFormat(rawValue: 11)
}