GSOC Report: Affinity Designer Import Extension for Inkscape (Inkaf)

Manpreet SinghManpreet Singh
7 min read

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:

  1. Write basic input extension

  2. Import text

  3. Add support SVG blend modes, Gaussian blur, vector crop, better editing

  4. Add support for Artboards and Guides

  5. Add support for images and better Vector Masks

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.

Shapes and styles in Affinity Designer
Shapes and styles in Inkscape
ToolPropertiesStatus
RectangleSingle Radius, Abs Size, Corner Type, Radius✓✓✓✓
Ellipse
TriangleTop Point
DiamondMid Point
TrapezoidLeft Point, Right Point✓✓
Curve ToolsPen, 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.

FeatureStatus
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
  1. Gradient Fill does not work similar to the Affinity Gradient. Inkaf's color interpolation is linear through the mid point.

  2. Conical Gradient is not supported.

  3. For Named Colors only the color is converted and the name is dropped.

Other Styles

StyleStatus
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✗✗
  1. Transformed objects have irregular stroke width

Transformations

Full support of transformations exist for the following:

TransformationStatus
Root Objects
Child / Sub-objects
Clips
Text: Artistic✓ [1]
Text: In Shape✓ [2]
Text: On Curve✓ [2]
  1. Transformation is directly applied to the text node

  2. 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

Variable stroke curves in Affinity Designer
Variable stroke curves in Inkscape
FeatureStatus
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.

Artboards in Affinity Designer
Artboards in Inkscape
FeatureStatus
Rectangular Artboards
Rotated or sheared Rectangular Artboards✓ [1]
Curve Artboards✓ [1]
Guide Lines
Grid Lines
  1. 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.

Vector Masks in Affinity Designer
Vector Masks in Inkscape
FeatureStatus
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.

Images in Affinity Designer
Images in Inkscape

Text

Text is partially implemented and is currently functional to a usable degree.

Text in Affinity Designer
Text in Inkscape
Text Tool TypeStatus
Artistic
Frame Text
Curve Path Text
Curve Text✓ [1]
Shape Text✓ [2]
FeatureStatus
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
  1. Text on multiple curves or multiple sides of the same curve is not supported

  2. Text that exceeds the bounds of the shape is not displayed.

  3. Line height is not correct for multi-line text.

  4. 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.

Blend Modes in Affinity Designer
Blend Modes in Inkscape

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.

0
Subscribe to my newsletter

Read articles from Manpreet Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Manpreet Singh
Manpreet Singh