Drawj2d News
Draw vector graphics to scale using a descriptive language
Brought to you by:
qwert2003
This is a release for reMarkable Paper Pro users. The reMarkable notebooks support colours.
Changes:
- rm output colours: black
, grey
or white
, blue
/inkblue
, red
/inkred
. New: green
, yellow
, cyan
, magenta
and (highlighter colours) pink
, lightgray
, lightgreen
and lightyellow
. Drawj2d will map darkgray to black, darkgreen to green, orange to yellow, darkorange to red, brown to gray, violet and purple to magenta and any other colour to black, grey or white depending on the brightness.
- rm output: image scan.png will use the current pen colour
- new command doubleline
Anonymous
Announcement on Reddit
Geometric shapes in rM notebooks - Drawj2d updated to support reMarkable Pro colours
Drawj2d is a tool to create technical line drawings in vector format (pdf, svg, ...). It can also write reMarkable notebook pages (rmdoc / rmn / rm). These notebooks are editable on the tablet, thus select/copy/paste works.
The command line program reads a text file that describes the drawing. The input language consists of commands such as line or label. Coordinates are given in natural units, e.g. [mm].
Version 1.3.4 is an update for reMarkable Paper Pro users. It brings colour support to the reMarkable notebooks.
The following colours are recognized
- black, grey or white
- blue
- red
- green
- yellow
- cyan
- magenta
- pink (highlighter colour)
- lightgray (highlighter colour)
- lightgreen (highlighter colour)
- lightyellow (highlighter colour)
Drawj2d will map the following colours to the available ones
- inkblue to blue
- inkred to red
- darkgray to black
- darkgreen to green
- orange to yellow (rmPro has a orange highlighter, but I do not know how to write that colour)
- darkorange to red
- brown to gray
- violet and purple to magenta
- any other colour to black, grey or white depending on the brightness
The rmPro has as slightly higher resolution than the rm2. If you want to get the drawing to scale you can tell drawj2d the resolution using the -r parameter:
drawj2d -Trmdoc -r229 drawing.hcl
For those interested only in coversion of pdf / svg / png to rM notebook there is a caveat:
- png are approximated with parallel monochrome lines. The current pen colour will be used (since 1.3.4):
echo pen red; image diagram.png | drawj2d -Trmdoc
- raster images embedded in svg work the same way as png. Raster images in pdf do not use the pen colour.
- pdf/svg colours are only applied if they match exactly the supported colour definition. Thus red (0xff0000) will result in red, but any close colour (e.g. 0xff2800) will turn in black/gray or white. So the notebook will be black/gray without colours in many cases.
To upload the notebooks created by drawj2d you can use the reMarkable desktop app (drag and drop the rmdoc file) or the USB web interface. RCU support for reMarkable Paper Pro is expected coming soon.
The supported pen colours for notebooks with colours on the rMpro are listed above. In the hcl file you can use them like this:
If you just convert a pdf (or svg) to a notebook using the following command on the command line:
then the colours are only applied if they match exactly the supported colour definition. Use the exact red-green-blue (rgb) values for the colours when you create the pdf/svg.
Pen colours:
The highlighter colours currently are (experimental)
(
echo 'Integer.toHexString(java.awt.Color.PINK.getRGB())' | jshell
)Any different colour (even close ones) will turn in black/gray or white. If we want to change that behaviour we will need an formula that maps the rgb colour space to the available nine pen colours.
Last edit: A. Vontobel 2024-10-07
The supported pen colours for notebooks with colours on the rMpro are listed above. In the hcl file you can use them like this:
If you just convert a pdf (or svg) to a notebook using the following command on the command line:
then the colours are only applied if they match exactly the supported colour definition. Use the exact red-green-blue (rgb) values for the colours when you create the pdf/svg.
Pen colours:
The highlighter colours currently are (experimental)
(
echo 'Integer.toHexString(java.awt.Color.PINK.getRGB())' | jshell
)Any different colour (even close ones) will turn in black/gray or white. If we want to change that behaviour we will need an formula that maps the rgb colour space to the available nine pen colours.
Forgot to mention in the release notes:
--deprecate --type rmapi (will be removed)
rMAPI supports
- rm
- rmdoc (since version 0.2.7)
Thus the old output type (zip file with old style metadata) is not needed anymore.
Due to a recent rM cloud API change you will need an up to date version of rmapi.