KorIM

KorIM

KorIM is a library for image loading, writing and processing. It allows to convert between image and color formats. Also includes tools for vector images and fonts.

This library is able to load PNG, JPEGs, BMPs, TGAs, PSDs and SVG vector images. Also allows rendering vectorial images using native rasterizers. The rasterizing capabilities is used by the Adobe Flash/Animate SWF loader. Also allows to use native image loaders for the fastest performance.

https://github.com/korlibs/korim

Star

Table of contents:

Pages

Bitmap classes

Bitmap base class + Bitmap8 and Bitmap32. And other fancy bitmaps: BitmapIndexed as base + Bitmap1, Bitmap2, Bitmap4 Ad BitmapChannel

Image Formats

Korim provides utilities for reading and writing some image formats without any kind of additional dependency.

PNG, JPG, TGA, BMP, ICO, PSD and DDS (DXT1, DXT2, DXT3, DXT4 and DXT5).

Color Formats

Korim provides color formats to convert easily and fast and to perform, mixing, de/premultiplication and other operations quickly.

Vectorial Image Formats

Korim supports loading, rasterizing and drawing vector SVG files.

Native vectorial rendering

It provides a single interface for vector rendering. So you can use a single interface and leverage JavaScript Canvas, AWT’s Graphics2D and Android Canvas. It allows converting shapes into SVG. Also allows to draw shapes with fills in contact without artifacts in a portable way.

AWT Utilities

Korim provides AWT utilities to convert bitmaps into AWT BufferedImages, and to display them. These are just extensions so not referenced from the main code.

Native Fonts

Korim provides native font rendering. You can rasterize glyph fonts on all targets.

Korio integration

Korim provides korio integration adding VfsFile.readBitmap() that allows Bitmap reading easily and faster (with native implementations) in some targets like browsers.

Using with gradle

Requires Gradle 7.1.1 (JVM 11~17) for building and Kotlin >=1.7.21 for running:

build.gradle.kts

val korimVersion = "4.0.2"

// For multiplatform projects
kotlin {
    sourceSets {
        commonMain {
            dependencies {
                implementation("com.soywiz.korlibs.korim:korim:$korimVersion") 
            }
        }
    }
}

dependencies {
    // For JVM only
    implementation("com.soywiz.korlibs.korim:korim-jvm:$korimVersion") 
    // For Android only
    implementation("com.soywiz.korlibs.korim:korim-android:$korimVersion") 
    // For JS only
    implementation("com.soywiz.korlibs.korim:korim-js:$korimVersion") 
}