GSOC Report: Affinity Designer Import Extension for Inkscape (Inkaf)
Project Summary
This summer, under the guidance of my mentor Jonathan Neuhauser, I (Manpreet Singh) developed an Inkscape extension to import Affinity Designer files, using Python. The extension is already included in the beta2 prerelease and will be bundled with Inkscape in the upcoming 1.4 release, making it available to millions of users. You can find the project on GitLab here.
The project is organized into the following three key phases:
Extraction of data files from the .afdesign file
Conversion of data files to readable JSON
Conversion of JSON data to SVG
Throughout the coding period, I contributed to the following merge requests:
Why use Inkaf?
Free and Open Source
Seamless Integration: Simply drag and drop your Affinity Designer files into Inkscape.
No pre-rendering, ensuring the SVG remains easy to modify and edit.
Cross-platform compatibility, allowing use on various operating systems.
Convert multiple files simultaneously with a simple command line script:
python -m inkaf.extract /path/to/dir/
Current State of support
Tools and Shapes
All tools in the toolbar are working as expected, except for the Contour tool, which has not been implemented yet. A few shapes have been fully implemented, but most shapes are still a work in progress.
Tool | Properties | Status |
Rectangle | Single Radius, Abs Size, Corner Type, Radius | ✓✓✓✓ |
Ellipse | ✓ | |
Triangle | Top Point | ✓ |
Diamond | Mid Point | ✓ |
Trapezoid | Left Point, Right Point | ✓✓ |
Curve Tools | Pen, Pencil, Corner, Vector Brush, Knife, Flood Fill, Shape Builder | ✓ |
Stroke Width Tool | ✓ | |
Artboard Tool | ✓ [See Artboards and Guides] | |
Vector Crop Tool | ✓ | |
Gradient Tool | ✓ [See Gradient Fill] | |
Text Tool | ✓ [See Text] | |
Contour Tool | ✗ | |
Other Shapes | ✗ |
Fill, Stroke and Opacity
Full support exists for objects with single fill and stroke. For objects with multiple fills or strokes, only one fill or stroke is applied.
Feature | Status |
No Fill | ✓ |
Solid Fill or Stroke | ✓ |
Gradient Fill or Stroke | ✓ [1][2] |
Bitmap Fill | ✗ |
Named Colors | ✓ [3] |
Opacity in the Layers Tab | ✓ |
Opacity in the Layer Effects menu | ✓ |
Gradient Fill does not work similar to the Affinity Gradient. Inkaf's color interpolation is linear through the mid point.
Conical Gradient is not supported.
For Named Colors only the color is converted and the name is dropped.
Other Styles
Style | Status |
Stroke Style: None, Solid, Dashed, Textured | ✓✓✓✗ |
Stroke Cap: Square, Butt, Round | ✓✓✓ |
Stroke Join: Bevel, Round, Miter | ✓✓✓ |
Stroke Align: Center, Inside, Outside | ✓ ✗✗ |
Stroke Order: Front, Behind | ✓✓ |
Stroke Dash Pattern | ✓ |
Stroke Width | ✓ [1] |
Stroke Variable Width | ✓ |
Stroke Markers: Start, End | ✗✗ |
- Transformed objects have irregular stroke width
Transformations
Full support of transformations exist for the following:
Transformation | Status |
Root Objects | ✓ |
Child / Sub-objects | ✓ |
Clips | ✓ |
Text: Artistic | ✓ [1] |
Text: In Shape | ✓ [2] |
Text: On Curve | ✓ [2] |
Transformation is directly applied to the text node
Translation and scale are applied to the shape, shear is applied to the text node
Curves or Paths
Full support exists for curves or paths
Feature | Status |
Multiple curves per path | ✓ |
Closed / Open curves | ✓ |
Artboards and Guides
Multiple pages (Artboards) are supported. An Artboard's bounding box is converted to an inkscape page [See image]. Guide lines are fully supported, however grid lines are not.
Feature | Status |
Rectangular Artboards | ✓ |
Rotated or sheared Rectangular Artboards | ✓ [1] |
Curve Artboards | ✓ [1] |
Guide Lines | ✓ |
Grid Lines | ✗ |
- The bounding box of the shape is converted to a page. The Artboard shape is added unmodified as a normal shape.
Vector Masks
Vector Masks will be fully supported with MR !13.
Feature | Status |
Single Mask | ✓ |
Clipping of Multiple Masks | ✓ |
Mask Alpha + Opacity Transfer | ✓ |
Apply max alpha for multiple objects in a single mask | ✓ |
Images and Rasterized objects
Images will be fully supported with MR !13. However, rasterized objects and embedded vector documents are not yet implemented.
Text
Text is partially implemented and is currently functional to a usable degree.
Text Tool Type | Status |
Artistic | ✓ |
Frame Text | ✓ |
Curve Path Text | ✓ |
Curve Text | ✓ [1] |
Shape Text | ✓ [2] |
Feature | Status |
Single line text | ✓ |
Multi line text | ✓ [3] |
Character Styles: | |
Font Family | ✓ |
Font style (narrow, bold, italic etc.) | ✓ |
Text color, background color | ✓ ✗ |
Text stroke styles | ✓ |
Underline and strike-through | ✓ [4] |
Position and transform menu styles | ✗ |
Typography | ✗ |
Optical Alignment | ✗ |
Paragraph Styles: | |
Line height | ✓ [3] |
Other spacing options | ✗ |
Vertical and horizontal alignment | ✗ |
Tab stops, Bullets and Numbering | ✗ |
Justification options | ✗ |
Text on multiple curves or multiple sides of the same curve is not supported
Text that exceeds the bounds of the shape is not displayed.
Line height is not correct for multi-line text.
Underline and strike-through cannot be applied together.
Color Spaces
Support for ICC color profiles is currently being developed in Inkex. In the meantime, basic color conversion from HSL, CMYK, and Gray to RGB is provided in Inkaf.
Blend Modes and Layer Effects
Currently, only the blend modes that are commonly supported by both SVG and Affinity Designer (16/32) are available in Inkaf. The remaining blend modes will likely be implemented using SVG filters.
Only the Blur Layer Effect has been implemented so far. Layer Adjustments and Wrap Groups are not implemented yet.
Acknowledgements
I want to extend a heartfelt thank you to Jonathan Neuhauser for their unwavering guidance and patience throughout this project. Your support has been invaluable! A special thanks to Martin Owens for the shoutout in the YouTube video(s).
Lastly, I am immensely grateful to Vladimir Mamonov and Hervé LEMAI for the development of Afread utility, which played a crucial role in the success of this project. I am also thankful to the users who generously provided the Affinity Designer test files, without which this project would not have been possible.
Subscribe to my newsletter
Read articles from Manpreet Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by