-
Notifications
You must be signed in to change notification settings - Fork 0
KRasterImporter
This defines how to import source images from your project's "Assets" folder into the Unity Editor.
Select one or more image files in the Project window so that the import settings appear in the Inspector.
Enable the desired import method, then click Apply.
No import method is enabled by default. If you want, you can select one of the included KRasterImporter presets (or create your own preset) and use the button on the Inspector to set it as the default for the project.
You can hover the mouse on any field's label to show a tooltip explaining what it does.
This is the recommended method, since that allows to use all features of Unity's built-in texture importer.
This will generate each image file on the specific path/name pattern you set.
You can then select these new texture asset files and import them as normal.
The default pattern generates the file on the same folder as the source image.

If Generate File is set to Animation, the default pattern will group the files for each frame under the same <name>/ folder and append the frame number suffix to the file name.

Parameters (e.g. <name>) are used to specify the path pattern generically. This allows you to import many files at once.
Simply hover the mouse on the field for a tooltip explanation of each parameter.
For example, if you want to change just the top folder under Assets to "Textures", you could use one of these:
<root>/Textures/<subpath>/<name>.<format><root>/Textures/_auto/<guid>.<format>
The Generate File importation method can use the External Program Mode when necessary - for example, when generating a file in any format other than PNG. Install Krita and enable the preferences to use this mode. The <format> parameter at the end will ensure that exr is used only when appropriate (since it requires the external converter program), otherwise png is preferred.
You can also use a different format if desired. Formats natively supported by both Unity and Krita include:
- PNG: recommended for all simple images
- EXR: recommended for linear HDR color images
- TIFF: used more in printers and scanners
- PSD: supports many advanced features, but it's proprietary
- TGA: simple format, but it's technically proprietary
- BMP: inappropriate for alpha channel or for compression
- JPEG: inappropriate for alpha channel and uses lossy compression
- GIF: inappropriate for alpha channel and uses only 256 colors
You should generally leave Generation Mode in Automatic, so the plugin automatically detects whether it should use Internal PNG Mode or External Program Mode. However, if you believe a specific file should be using a different mode, you can force it on just that file.
If you want to change the default texture import settings for the generated files, you can create custom TextureImporter preset patterns for their specific folders, according to your use case.
You might prefer to import textures and sprites directly as sub-assets. To do so, set the Import Image field.
This direct importation method doesn't have all the same options as Unity's built-in importer, but, on the other hand, you may prefer its convenience of grouping assets together. It uses the Internal PNG Mode, which reads the flattened PNG data (merged image) as it was rendered by the image editor. It's fast and doesn't require installing any separate program.
Most options here correspond to the same option in Unity's built-in Texture Importer or Sprite Editor, so only differences will be explained below.

You can override the texture name here if desired. The default pattern just uses the file name. Hover for a tooltip explanation of each parameter.
You probably want this enabled. If you're dealing with linear files, where you would need to disable this field, you have to be careful because the PNG data used in importation may still be in sRGB space even when the source file is linear. You'll see a warning if the plugin thinks this setting has the wrong value. When in doubt, it's simpler to instead use external mode to generate a separate EXR file for linear files and use the built-in importer on that file.
Leave it enabled unless you're using the alpha channel for something other than opacity. If enabled, a color dilation filter is applied to the RGB channels of fully transparent pixels, which are normally visually ignored, but not in bilinear/trilinear filter modes; this flag fixes outline artifacts in those. If you choose to import as an opaque format (no alpha channel), then this flag controls whether it should put the image over a black background or just discard the alpha channel. It also affects resampling filters and other things.
Appears when you enable Generate Mipmaps, allowing you to set if the texture uses mipmap limits and if so, from which mipmap limits group. Edit groups in Quality Settings, but note that unlike the built-in importer, if you rename or delete a group there, this won't be updated automatically.
You can set a single value or set it per-axis individually. To show the field for each axis, change the value in the little dropdown at the right. Change the axes to the same value to unify the fields again.
If zero, there's no maximum size and this is ignored. If non-zero, the largest of width or height is downscaled to fit this size if bigger, preserving aspect ratio. Resizing will use the Resampling Filter below. If you need to set this per-platform, use the built-in importer instead.
The filter to use when resizing the texture. Only used during importation, unlike Filter Mode, which is used at runtime. By the default preferences, this operation is performed in the GPU. Filters are sorted from simplest to most complex to compute. The default looks fine in most cases, but you can change it if it fits the image's style better.
- Point (Nearest Neighbor): Only uses original colors, without blending. Very fast, but can cause all sorts of artifacts.
- Box (Square): Merges points within the target box area equally, for fully blocky pixelated jaggies.
- Bilinear (Triangle): Linearly interpolates the 4 surrounding pixels by average weighted on proximity.
- Hermite (Blocky Bicubic): Smoothed triangular filter for edge-rounding but blocky results.
- B-spline (Blurry Bicubic): Very smooth interpolation that emulates a Gaussian blurring filter.
- Catmull-Rom (Sharp Bicubic): Cardinal spline filter considered satisfactory by image experts to avoid blurring.
- Mitchell-Netravali (Fine Bicubic): BC-spline filter deemed satisfactory by image experts to generally avoid artifacts.
Base format for the texture. The actual format will depend on the platform target, subtarget and the compression option.
- Automatic: Automatically selects an appropriate format. No alpha channel when all pixels are opaque.
- RGBA8: Truecolor + alpha channel. 32bpp.
- RGB8: Opaque truecolor. 24bpp.
- RG8: Red and green channels. 16bpp.
- R8: Red channel. 8bpp.
- RGBA4: 4096 colors + alpha channel. 16bpp.
- R5G6B5: 65536 opaque colors. 16bpp.
If you need a different format, platform-specific overrides, or any other feature unavailable here (including HDR), generate a separate file and use Unity's built-in importer instead of this direct importation method. Only in external mode you can create EXR files.
This setting controls both the format used for compression and compression quality. Selecting None or Low Quality makes assets be imported faster. High Quality is slower to compress.
You can also use the Texture Compression field in Asset Import Overrides, in Build Settings to force fast or no compression during development. However, note that changes may only affect future importations, i.e. the Apply Overrides button may only cause the built-in texture importer to re-run. After applying the change, if you want to also update all textures from this importer right away, search for t:SourceImage in Project, select all results and click Assets menu > Reimport.
When the Import Image field is set to Texture 2D, you can also import sprites by setting Sprite Mode.
Set it to Sprite to import a single sprite.
![]()
Set it to Spritesheet to import sprites from a grid-based slicing of the texture. If your spritesheet isn't grid-based, just gererate an image file and use Unity's Sprite Editor instead.
![]()
Amount of space around the whole image to ignore when creating sprites. This works like a cropping operation.
How to slice the grid. Choose Cells to specify the number of Grid Cells, or choose Pixels to specify the size in Cell Pixels. Use a negative number if you want to reverse the order.
Amount of pixels to skip between grid cells.
The default Row-major means cells are grouped row-by-row. Use Column-major instead if you want to slice vertically, column-by-column.
If enabled, detects empty cells to skip them. Empty cells are cells where all pixels use the empty color defined here. If Alpha Is Transparency is enabled and you use a fully transparent color, only the opacity channel is compared.
What size in the sprite corresponds to 1 unit in the world. This is the sprite's Pixels Per Unit setting when the unit is set to px. Otherwise, this value will be set relatively to full image size (regardless of margin) or to pixel density (ppi or px/cm) as set in the image editor.
-
px: Value is the exact amount of Pixels Per Unit.
E.g., 100px means 100px in the unscaled sprite is 1 world unit. -
in, cm: Value is the amount of inches or centimeters per world unit, measured using the image's pixel density value. This allows you to design sprites using these physical units in the image editor.
E.g., 100cm means 1 meter in the unscaled sprite is 1 world unit. -
% width, % height: Value is Pixels Per Unit relative to % of either width or height of full image.
E.g., 25% width means unscaled sprite width is 4 world units (if sprite is full image without margin). -
% container: % of width or height of full image, whichever is larger, per world unit.
E.g., when it's 100% containing, then an unscaled full image will fit inside a 1x1 world unit square without stretching. -
% coverage: % of width or height of full image, whichever is smaller, per world unit.
E.g., when it's 100% covering, then: if an unscaled image has "portrait" aspect, its full width will cover 1 world unit; if it has "landscape" aspect, full height will cover 1 unit.
Name pattern for the sprites. Hover for a tooltip explanation of each parameter.
Disable if you don't want to make a sprite for every grid cell. Then only the cells covered by Spritesheet Regions will be used. If enabled, cells not already covered by regions will also become individual sprites.
Typically, on simple grid-based spritesheets where all sprites are of the same size (using a single cell), you would enable this and not use any regions.
Corresponds to the normalized Custom Pivot setting, where (0, 0) is bottom left and (1, 1) is top right.
Use the little dropdown to conveniently set the most common values.
In more advanced spritesheets, use this to declare regions that define sprites in terms of grid cells. This way you can merge cells to form larger sprites, while still keeping the other 1x1 cell sprites formed from having Grid Sprites enabled.
Sprite Names can be overriden in sprites within the regions by setting a non-empty value. Border and Pivot will always be overriden.
The cell coordinates of where the region starts.
Amount of cells to merge to form a sprite within this region.
Number of cells to skip between sprites in this region.
Number of sprites in this region.

The preview area can be configured in the preferences. It shows info about the source image being inspected:
- File extension (
KRA,KRZorORA) - Image size in pixels (e.g.:
512×512) - If the file has animation frames:
- Number of frames (e.g.:
×8) - Framerate (e.g.:
@8fps) - Duration (in seconds, e.g:
0.25s)
- Number of frames (e.g.:
- Pixel density (ppi or px/cm)
- If the color space is recognized:
- Color format (e.g.:
RGBA16f) composed of:- Color model (e.g.: RGBA, GrayA, CMYKA, YCbCrA)
- Bit depth per channel (8-bit, 16-bit, 32-bit)
- Range (if it ends with
f, channels are float, which allows HDR; otherwise it's integer)
- Tone response curve (TRC):
-
linear(gamma=1) or decoding gamma value (e.g.:gamma[2.2]) -
sRGBor anothertrc[...](e.g.: BT.709, PQ, L*)
-
- Color gamut:
-
sRGBor anothergamut[...](e.g.: Rec2020, DisplayP3, AP1)
-
- Color format (e.g.:
- If color space couldn't be inferred:
- Color profile name (
icc[...])
- Color profile name (
- File length in bytes (e.g.:
1.2MiB) - When internal PNG info is shown:
- PNG image size in pixels (when different)
- PNG color format (e.g.:
RGBA8) - PNG length in bytes (e.g.:
12.3KiB)