Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Sources/SwiftGD/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@ public class Image {
gdImageTrueColorToPalette(internalImage, shouldDither, Int32(numberOfColors))
}

/// Extends the image color palette to truecolor.
/// It should be used when you're encountering color allocation failures with palette-based images or
/// when you need to perform operations that require more than 256 colors.
///
/// - Note: The reverse option might cause a loss of color information
/// - SeeAlso: `reduceColors()` for the reverse operation (converting truecolor to palette-based).
public func extendColors() {
gdImagePaletteToTrueColor(internalImage)
}

deinit {
// always destroy our internal image resource
gdImageDestroy(internalImage)
Expand Down