A raster image editor extension for VS Code
Full TGA support (#131)
TGA files can now be saved as the codec library @lunapaint/tga-codec
now supports encoding TGA files.
Save as to change file type
Save as will now save the image using the matching type of the file.
Readonly TGA support (#131)
The new TGA decoder library @lunapaint/tga-codec
is published on npm and open sourced. Much like @lunapaint/png-codec
, the goal was to build a fast and correct typescript-based library that runs in both browser or node contexts. It has a readable codebase and provides advanced insights into what went wrong when the file fails to decode.
This means Luna Paint can now open TGA files (not save yet) and also inspect them via the luna.file.inspectImageFile
command to view metadata, warnings, etc.
While building this library I noticed that the decoding of TGA files is somewhat inconsistent across image editors due to the specification not being clear on certain things, to combat this @lunapaint/tga-codec
uses what seems to be the most correct approach. One example of this is some images may open "correctly" in some editors but completely transparent in others, a novel feature I added was the ability to detect this "ambiguous alpha channel" and open it with a warning. The idea is if you have a warning in your image file you should probably re-save it in order to improve compatibility of the file.
The next steps for @lunapaint/tga-codec
is to write the encoder side of the library which will allow saving of TGA files as well as improving test coverage of the decoder by creating a comprehensive test suite.
Other enhancements
luna.defaultTool
setting the default has changed to the selection tool which seems more appropriate. To get the old behavior add this to your settings: "luna.defaultTool": "pencil"
.luna.file.inspectImageFile
command now works on the active file, thanks to a new vscode API.New web native PNG encoder (#125)
In v0.13 @lunapaint/png-codec
was open sourced as a new TS-based PNG decoder, this release saw the development of the encoding part of the library. Here are the main things that means for Luna Paint:
New web native PNG decoder (#122)
The bulk of the time this release was spent creating a new PNG decoder library and making it very polished and tested (currently ~3500 tests and > 97% coverage). The new library @lunapaint/png-codec
is published on npm and is the first core component in Luna Paint to be open sourced! The goal was to build a fast and correct typescript-based library that runs in both browser or node contexts. It has a readable codebase and provides advanced insights into what went wrong when the file fails to decode.
The main wins this brings to Luna Paint so far are:
The next steps for @lunapaint/png-codec
is to write the encoder side of the library which will allow ultimate control for Luna Paint (and the user) over how the PNG will be saved.
Inspect image file
There's a new context menu in the explorer for inspecting low level details of image files for supported types. Currently only PNG is supported but this will be expanded as more progress is made on format decoders.
Details provided include:
Warnings/error status bar item
When errors or warnings are encountered during decoding, a new status bar item will show when file inspection is supported. A notification was considered for this but the status bar items were determined to be just as intuitive as a notification but less annoying.
Resize image and canvas by percentage (#130)
The Image: Resize
and Image: Resize Canvas
commands now support percentages, including in the shorthand so the following formats are now possible: w
, w%
, wxh
, w%xh
, wxh%
"workbench.list.openMode": "singleClick"
setting.File >
, Image >
) have now moved into the main category (eg. Luna > File
, Luna > Image
). This allows commands to show up nicely in context menus in addition to keeping the sub-category idea in the command palette.Image: Canvas Size
command has been renamed to Image: Resize Canvas
to improve discoverability in the command palette.Colors window
A new "Colors Window" has been added which contains a large HSV selector:
Details and more sliders can be shown by clicking the >
button at the top of the window:
Here are some of the features/changes in the new window:
luna.palette.swapColors
command has been changed to luna.color.swapColors
.Slimmed down palette window
With the introduction of the new Colors Windows, the Palette Window has been slimmed down significantly. It is no longer visible by default but can be toggled by triggering the Toggle Palette Window
command.
Shape tool: Diamond
The shape tool can now also draw a diamond:
Blend mode support in fill tool
Full blend mode support now works for the fill tool. With this you can now replace the pixels without blending them for example.
Message on copy
A message is now shown to confirm when a selection is copied and what the dimensions of copied image are. This makes it more obvious what the dimensions are and also helps confirm that the copy action actually did occur, in case there was some keybinding issue with VS Code.
A lot of effort when into building out an integration test suite using @playwright/test
over the past 2 months which has fixed many minor issues and will boost reliability and prevent future regressions.
github.dev and restored Codespaces support
GitHub now features a lightweight serverless text editor called github.dev that compliments the compute-backed Codespaces. This release is out a little early to ship support for github.dev and restore Codespaces support which broken recently in new browser versions that restricted the use of SharedArrayBuffer
.
This means you can edit images in a GitHub repo for free using your browser! Just hit .
on your repo and enable settings sync to synchronize your extensions.
A decent amount of changes were needed to make this support work so as always let me know if you hit problems.
Color at Pointer (#86)
There is a new status bar item that will show the color under the cursor position, it updates when paused briefly on a pixel to reduce visual noise.
Clicking on the status bar item will toggle between sampling the current layer of all layers, behind the scenes this will toggle the new luna.statusBar.pointerColor
setting.
Auto save warning
There is a new warning that appears in the status bar when auto save is using the afterDelay
mode as this can cause frames to drop while drawing, leading to jagged lines.
While it uses the warning color to grab your attention, it was a priority to make this as unobtrusive as possible. You can left click on the item to dismiss it for this session or right click to hide it permanently.
Other enhancements
Text tool (#48)
A new text tool has been added, allowing flexible drawing of text with the following features:
Shape tool: Right-angle triangle
The shape tool can now also draw a right-angle triangle:
Other enhancements
luna.selection.eraseKeepSelection
allows erasing the selection without deselecting.luna.retainContextWhenHidden
is false.