-
Notifications
You must be signed in to change notification settings - Fork 0
Getting started
-
Download pikt.jar from the releases section or build it yourself and put the JAR file anywhere. Make sure Java 8 or above is installed.
-
Generate a color scheme with default values. This operation is optional, however using an external scheme is always preferred over using the internal one as some values may change from version to version.
In order to generate a scheme run the following command:java -jar pikt.jar -createscheme=name
This will create a.properties
file in the same folder as the JAR file. If you want to pick another location use an absolute path instead.
The downloadable zip file already contains a scheme calledcolors
. -
Create a very small (i.e. 5x5 px) white-filled image with any editor you like. I personally use Photoshop, but any tool that allows you to zoom in enough will be good.
To check if you have done everything right until now run Pikt with the following command:
java -Dsource=your_image.png -Dcolors=your_scheme -jar pikt.jar -printoutput -nocompile
This should print an empty output, which is normal since your source image is blank.
-
Download the Kotlin compiler and extract it anywhere. Pikt supports compilation on both the JVM and native compiler and interpretation only on the JVM.
The downloadable zip file already comes with the JVM compiler. -
Choose whether the JVM or the native compiler (or both) should be used. Declare these properties (before the
-jar
) depending on the compiler you are willing to use:
-
-Djvmcompiler=jvm_kotlin_compiler_path/kotlinc/bin/kotlinc
(+.bat
on Windows) -
-Dnativecompiler=native_kotlin_compiler_path/bin/kotlinc
(+.bat
on Windows)
- Define compilation and/or interpretation targets.
Available compilation targets:jvm
,windows
,osx
,linux
. Windows and OSX executables can be generated from their respective OS only.
Available interpretation targets:jvm
.
Set properties, for example:-Dtargets=jvm,linux
,-Dinterpret=jvm
If both are present interpretation will run first.
Complete command with all properties set:
java -Dsource=your_image.png -Dout=out -Dcolors=your_scheme -Dtargets=... -Dinterpret=... -Djvmcompiler=... -Dnativecompiler=... -jar pikt.jar
Note that the native compiler will take up some time to download its dependencies on the first run.