- 使用指南
- 数字绘画基础知识
- 参考手册
- 实例教程
- 常见问题解答
- 参与者手册
- 扩展包和第三方教程
- 其他
- 显示设置
- 日志查看器
- 数位板设置
- Automated Krita builds on CI matrix
- Brush GUI Design with Lager
- Building Krita from Source
- CMake Settings for Developers
- Enable static analyzer
- How to patch Qt
- Introduction to Hacking Krita
- The Krita Palette format KPL
- Krita SVG Extensions
- Modern C++ usage guidelines for the Krita codebase
- Developing Features
- Optimize Image Processing with XSIMD
- Optimizing tips and tools for Krita
- Google Summer of Code
- Advanced Merge Request Guide
- Python Developer Tools
- Introduction to Quality Assurance
- Making a release
- Reporting Bugs
- Strokes queue
- Testing Strategy
- Triaging Bugs
- Unittests in Krita
- 矢量图层
- 常规设置
- 颜料图层
- 图层组
- 克隆图层
- 文件图层
- 填充图层
- 滤镜图层
- 笔刷引擎
- 透明度蒙版
- 滤镜笔刷引擎
- 滤镜蒙版
- 裁剪工具
- 移动工具
- 变形工具
- 变形笔刷引擎
- 变形蒙版
- 网格与参考线
- 工作区
- 笔刷预设
- 色板
- 键盘快捷键
- 设置菜单
- 性能设置
- 笔尖
- 不透明度和流量
- 常用笔刷选项
- 多路笔刷工具
- 手绘笔刷工具
- 直线工具
- 曲线工具
- 辅助尺工具
- 图层
- 矩形选区工具
- 椭圆选区工具
- 多边形选区工具
- 手绘轮廓选区工具
- 相似颜色选区工具
- 相连颜色选区工具
- 曲线选区工具
- 磁性选区工具
- 形状选择工具
- 锚点编辑工具
- 工具菜单
- 动画时间轴
- 绘图纸外观
- 动画曲线
- 分镜头脚本
- 颜色
- 色域蒙版
- 美术拾色器
- 多功能拾色器
- 智能填色蒙版工具
- *.gih
- 像素笔刷引擎
- *.kra
- SeExpr
- SeExpr 脚本
- 渐变
- 颜色涂抹笔刷引擎
- 纹理
- 拾色器工具
- LUT 色彩管理
- 小型拾色器
- 有损和无损图像压缩
- *.bmp
- *.csv
- *.exr
- *.gbr
- *.gif
- *.heif 和 *.avif
- *.jpg
- *.jxl
- *.kpl
- *.ora
- .pbm、.pgm 和 *.ppm
- *.png
- *.psd
- *.svg
- *.tiff
- *.webp
- 数学运算
- 变暗
- HSX
- 变亮
- 颜色混合
- 负片
- 其他
- 二元逻辑
- 取模运算
- 二次方
- 鬃毛笔刷引擎
- 粉笔笔刷引擎
- 克隆笔刷引擎
- 曲线笔刷引擎
- 力学笔刷引擎
- 网格笔刷引擎
- 排线笔刷引擎
- MyPaint 笔刷引擎
- 粒子轨迹笔刷引擎
- 快速笔刷引擎
- 形状笔刷引擎
- 草图笔刷引擎
- 喷雾笔刷引擎
- 切线空间法线笔刷引擎
- 笔刷选项
- 锁定笔刷选项
- 蒙版笔刷
- 传感器
- 添加形状
- 动画
- 矢量图形排列
- 笔刷预设历史
- 色彩通道
- 颜色滑动条
- 图层显示方案
- 过渡色调混合器
- 直方图
- 导航器
- 图案
- 录像工具
- 参考图像
- 形状属性
- 图像版本快照
- 量化拾色器
- 操作流程
- 触摸屏辅助按钮
- 撤销历史
- 矢量图形库
- 宽色域拾色器
- 调整颜色/图像
- 艺术效果
- 模糊
- 边缘检测
- 浮雕
- 图像增强
- 映射
- 其他
- 小波分解
- 图层样式
- 选区蒙版
- 拆分透明度通道到蒙版
- 编辑菜单
- 文件菜单
- 帮助菜单
- 图像菜单
- 图层菜单
- 选择菜单
- 视图菜单
- 窗口菜单
- 作者档案设置
- 画布快捷键设置
- 隐藏面板模式设置
- 色彩管理设置
- 拾色器设置
- G’Mic 设置
- 弹出面板设置
- Python 插件管理器
- 笔尖
- 笔刷预设
- 图案
- 文字工具
- 渐变编辑工具
- 图案编辑工具
- 西文书法工具
- 矩形工具
- 椭圆工具
- 多边形工具
- 折线工具
- 手绘路径工具
- 力学笔刷工具
- 填充工具
- 闭合填充工具/圈涂
- 渐变工具
- 智能补丁工具
- 参考图像工具
- 测量工具
- 缩放工具
- 平移工具
- Building Krita with Docker on Linux
- Building krita on host Linux system (unsupported)
- Building Krita for Android
- Working on Krita Dependencies
- 渐变
- 多维网格
- 图案
- 网点
- 单纯形法噪点
The Krita Palette format KPL
There’s been a number of color swatch definitions over the years. To ensure we can store color managed color, as well as store other metadata we use, Krita has its own color palette format, KPL.
This document is a technical description of the format.
Basic Structure
KPL files are zip files containing the following files:
- mimetype
A text file containing the mimetype, to differentiate it from a regular zip.
application/x-krita-palette
- colorset.xml
The main color definition file.
- profiles.xml
This is a manifest of the icc profiles that are inside the zip file. We wanted to have no ambiguity in regards to which icc files were bundled.
- A number of icc files.
These are the necessary icc profiles for interpreting the values in colorset.xml
profiles.xml
A manifest of the icc profiles that are inside the zip file. We wanted to have no ambiguity in regards to which icc files were bundled.
<Profiles> <Profile name="sRGB-elle-V2-g10.icc" filename="sRGB-elle-V2-g10.icc" colorModelId="RGBA" colorDepthId="F32"/> </Profiles>
Krita doesn’t store every profile it uses. XYZ and LAB are colorspaces that only have one real space definition, and therefore it doesn’t make sense to embed these files.
colorset.xml
This is the main palette definition. It can handle comments, groups and more.
The top level element is a Colorset
element, it’s children can either be ColorSetEntry
elements, or Group
elements. ColorSetEntry
s that are direct children of Colorset
are the ungrouped colors, and are, inside Krita, referred to as the “default” group.
<Colorset name="Scene Linear Swatches" comment="This is a palette for easy access to some swatches ready for scene-linear painting." columns="9" rows="1" readonly="false" version="1.0">
- name
The human friendly name of the color palette.
- comment
The description for the palette.
- columns
The amount of columns in the palette in total. This is the same for all groups.
- rows
The rows of the default group, see group for more info.
- readonly
Whether the file can be edited.
- version
The version of the file.
Group
Group
elements can only have ColorSetEntry
s as children. Group
s are shown in the UI as a grid where the cells can be empty or contain a ColorSetEntry
.
<Group name="Hot Colors" rows="5"> </Group>
- name
The name of the group.
- rows
The total amount of rows this group takes up, this, together with the column value in the toplevel
Colorset
element, determines the grid size.
ColorSetEntry
<ColorSetEntry name="Noon daylight at 0 EV" id="SI-D65-0EV" bitdepth="F32" spot="false"> <XYZ space="XYZ identity built-in" x="0.17107713223" y="0.18000000715" z="0.17107713223" /> <Position row="0" column="0"/> </ColorSetEntry>
- name
The name of the color. Unlike the create swatches, we don’t support translated color names.
- id
The id value. This is for complex colorsets where there is a human friendly name, and a name that uniquely identifies the color in the swatch database. In the above example, which encodes the D65 standard illuminant at 0 stops,
SI-D65-0EV
is a clear unambiguous id, but “Noon daylight at 0 EV” is a much more human friendly way to refer to it. Often, the ID is used for referencing spot colors inside files.- bitdepth
The bitdepth at which the color should be loaded. This is largely for our own convenience. Values are U8 (Unassigned 8bit integer), U16 (Unassigned 16bit integer), F16 (16 bit Floating Point), and F32 (32 bit Floating Point). Lab and CMYK don’t support F16, and for CMYK F32 is not recommended because it doesn’t deserialize the same way as the integer colorspaces.
- spot
Whether or not the color is a spot color. This is currently not used elsewhere in Krita, but the intend is to use it for encoding spot colors as only the id.
ColorSetEntry
s have two children:
The Position
element is the position of the swatch inside the parent group grid. Krita doesn’t store empty swatches.
The other child element is a Create Swatch defintion. Krita supports Gray, sRGB, RGB, XYZ, CMYK, Lab and in theory YCrCb. Note that Krita supports unbounded colors as long as the bitdepth is F32.
Color swatch definition from the Create Wiki:
The following is the Color Swatch definition from the old create wiki . Krita largely uses this definition. Because the Create wiki is down, it’s contents are reproduced here. It is for reference only.
<colors xmlns:xlink="http://www.w3.org/1999/xlink"> <color name="blue"> <label lang="en">Blue</label> <label lang="es">Azul</label> <label lang="en_US_SoCal">glassy</label> <CMYK space="2ndFloorCMYK" c="0.8703" m="0.6172" y="0" k="0"/> <Lab space="mine" L="34.67" a="54.1289" b="-103.3359"/> <HSV space="prof01" h="240" s="1" v="1"/> <HLS space="prof02" h="240" l="0.5" s="1"/> <Luv space="prof03" L="34.6701" u="-15.0121" v="-124.7986"/> <XYZ space="prof04" x="0.1566" y="0.0833" z="0.7196"/> <Yxy space="prof05" Y="0.0833" x="0.1632" y="0.0869"/> <Gray space="prof06" g="0.2515"/> <sRGB r="0" g="0" b="1.0"/> <RGB space="lcd" r="0.1608" g="-0.1518" b="1.0753"/> </color> <color name="red"> <label lang="en">Red</label> <CMYK space="2ndFloorCMYK" c="0.0011" m="0.7992" y="0.9405" k="0.0038"/> <sRGB r="1.0" g="0" b="0"/> </color> <colorspace name="2ndFloorCMYK" xlink:href="2nd_floor.icm"/> <colorspace name="mine" xlink:href="sample.icm"/> <colorspace name="lcd" xlink:href="generic_lcd.icm"/> </colors>
Relax-NG for the swatches
namespace xlink = "http://www.w3.org/1999/xlink" grammar { start = element colors { color+, colorSpace* } color = element color { attribute name { text }, label *, (RGB ? & sRGB ? & CMYK ? & Lab ? & HSV ? & HLS ? & Luv ? & XYZ ? & Yxy ? & Gray ? & YCbCr ?) } label = element label { attribute lang { text } ?, text } spaceAttribute = attribute space { text } RGBAttributes = attribute r { xsd:float }, attribute g { xsd:float }, attribute b { xsd:float } RGB = element RGB { spaceAttribute, RGBAttributes } sRGB = element sRGB { RGBAttributes } CMYK = element CMYK { spaceAttribute, attribute c { xsd:float }, attribute m { xsd:float }, attribute y { xsd:float }, attribute k { xsd:float } } Lab = element Lab { spaceAttribute, attribute L { xsd:float }, attribute a { xsd:float }, attribute b { xsd:float } } HSV = element HSV { spaceAttribute, attribute h { xsd:float }, attribute s { xsd:float }, attribute v { xsd:float } } HLS = element HLS { spaceAttribute, attribute h { xsd:float }, attribute l { xsd:float }, attribute s { xsd:float } } Luv = element Luv { spaceAttribute, attribute L { xsd:float }, attribute u { xsd:float }, attribute v { xsd:float } } XYZ = element XYZ { spaceAttribute, attribute x { xsd:float }, attribute y { xsd:float }, attribute z { xsd:float } } Yxy = element Yxy { spaceAttribute, attribute Y { xsd:float }, attribute x { xsd:float }, attribute y { xsd:float } } YCbCr = element YCbCr { spaceAttribute, attribute Y { xsd:float }, attribute Cb { xsd:float }, attribute Cr { xsd:float } } Gray = element Gray { spaceAttribute, attribute g { xsd:float } } colorSpace = element colorspace { attribute name { text }, attribute xlink:href { xsd:anyURI } } }
Using for validating
To use the above RelaxNG compact schema to validate a swatch you can use:
trang -I rnc -O rng colors.rnc colors.rng xmllint --relaxng colors.rng colors.xml
Color Grouping Proposal
Krita doesn’t use this.
<group> <label lang='en'>One group</label> <color name='red'> <label lang='en'>Red</label> <sRGB r="1.0" g="0" b="0"/> </color> <group> <label lang='en'>Nested group</label> ... </group> </group> <group>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论