Open Source Swift API for server-Side Image Processing

Swift Library for included support for image loading, saving, and manipulating. It allows image creation with custom width and height, image resizing & cropping a specific part of the image

SwiftGD is a small size wonderful library that supports server-side Swift image manipulation. It a fantastic Swift wrapper for libgd, allowing the creation of images and draw shapes in places where Core Graphics functionality isn’t available. The library is simple to use and can easily handle image loading, saving, and manipulating using Swift code. One great feature of the library is that it manages GD resources for users, so the underlying memory is released when the images are destroyed.

The library is supports several important features related to image handling such as PNGs & JPEGs loading from disk, PNGs & JPEGs images saving to disk, image creation with custom width and height, image resizing support, cropping a specific part of the image, drawing shapes and lines, color filing from coordinates, horizontal or vertical image flipping, image stroking support, drawing or text filling and many more. The library has also included several important effects such as pixelate, blur, colorize, de-saturate, and so on. . The library is open source and is available under the MIT License.

Previous Next

Getting Started with SwiftGD

Clone the latest sources using the following command.

Install SwiftGD via Github

 $ git clone

Creating New Images using Swift

The open source Swift library SwiftGD enables software developers to create new images with just a couple of lines of Swift code. Developers can easily create an image from scratch by providing the width and height of the image. It also supports creating images from data instances. It also generates Images while users perform a resize or crop operation, which means the original image will be untouched. You can also apply some basic effects on images with ease.

Shapes Drawing using Swift

The SwiftGD library makes it easy for software developers to draw and manipulate shapes inside their Swift applications. The library has provided several methods that can be used to draw into your images, such as apply flood fill from one point to the other, drawing a line from one point to the other, pixel setting a specific point, fills an ellipse at the center, drawing an empty ellipse at the center, empty rectangle drawing from one side to the other and so on.

Image Manipulation inside Swift Apps

The open source Swift library SwiftGD allows computer programmers to manipulate images with ease inside Swift apps. The library has provided several methods which can be used to apply effects to images such as applying a Gaussian blur effect, applies image tint, renders your image grayscale, flips your image horizontally as well as vertically, simplifies your image to large pixels, and much more.

Images Loading & Reading

The free Swift library SwiftGD gives software apps the capability to load and read images inside their own Swift apps. You need to provide the location of the image on the disk for successful loading. The file extension is used by the library for loading the correct file format, so it's important you name your files with"jpg","jpeg", or"png".