Plugin which adds selection tools to mask objects in your image with a single click, or by drawing a bounding box.
Click on things to select them!
SegmentFromPoint.mp4
Draw a box around things to select them!
SegmentFromBox.mp4
Object detection works quite well in both photos and artwork. As a solution for masking the rough shape of distinct objects and regions it is usually much quicker than lasso tool, and more flexible than contiguous selection tool ("magic wand"). Computation is instantanious for medium resolution on recent hardware (especially GPU), for high resolutions there is a noticeable delay.
The generated masks are binary masks, and typically not pixel-perfect, especially for large resolutions (the mask is always an upscale from 1024x1024). It might be possible to improve with tiling, or a subsequent alpha-matte step.
The current version of the plugin is built for Krita 5.2.0 and has been confirmed to also work for Krita 5.2.2. Using it with other versions may lead to crashes.
You can download the latest version of the plugin from the releases page.
Download the plugin and unpack the ZIP archive into your Krita installation folder. Then run Krita.
You can use this script to download and patch Krita with the plugin. It also creates a shortcut to run it.
To do it manually, get the Krita AppImage from the official source and extract it. This should result in a folder squashfs-root
. Download the plugin tar.gz
and extract it into that folder. Then run Krita. See the commands below for some environment variables that are needed to run outside the image.
./krita-5.2.0-x86_64.appimage --appimage-extract
tar -xf krita_segmentation_plugin-linux-x64-1.0.2.tar.gz -C squashfs-root/
APPDIR=/squashfs-root APPIMAGE=1 ./squashfs-root/AppRun
Arch users can use the PKGBUILD
on the AUR, or with yay
or paru
:
yay -S krita-ai-tools
# or
paru -S krita-ai-tools
The plugin has to be built as part of Krita, see Building Krita from Source.
After GIT checkout, clone this repository into the plugins folder:
cd krita/plugins
git clone https://github.com/Acly/krita-ai-tools.git
Next modify the CMakeLists.txt
in the same folder (krita/plugins
) by appending the following line:
add_subdirectory( krita-ai-tools )
Now build and install Krita as usual according to official instructions, and the plugin will be built alongside.
Object detection uses the Segment Anything Model, a deep neural network developed by Meta AI. To get interactive performance on local hardware, an optimized version of the model (MobileSAM) is integrated using the dlimgedit library.