Seamless, headless and fully tested HTML5 Canvas library
MIT License
Bot releases are visible (Hide)
Published by raminious 8 months ago
Published by raminious 11 months ago
Published by raminious over 1 year ago
Published by raminious over 1 year ago
This release includes one fix and all dependencies have been updated to their latest versions:
Published by raminious over 1 year ago
In addition to one fix, all dependencies have been updated to their latest version in this release:
Published by raminious almost 2 years ago
global.DOMMatrix
variable has been fixed to avoid conflict with PDF.js (https://github.com/pikasojs/pikaso/commit/09beab601a28ebd6691de9e4755aa24b07218d73)Published by raminious about 2 years ago
Published by raminious over 2 years ago
Published by raminious over 2 years ago
Published by raminious over 2 years ago
As of version 2.7.0, NodeJs is supported. This will enable collaboration between backend and frontend sides in creating images.
Using Pikaso in a NodeJs environment is similar to using it in a browser.
npm install canvas
const { Pikaso } = require('pikaso')
const editor = new Pikaso({
width: 800,
height: 600
})
Published by raminious over 2 years ago
From v2.6.0, both editor.loadFromUrl
and editor.loadFromFile
accept a second parameter with this interface
interface BackgroundOptions {
size: 'auto' | 'resize' | 'cover' | 'contain' | 'stretch'
x: number
y: number
}
The size
field describes how a background image should be loaded in the canvas. The functionality is the same as the CSS feature background-size
.
editor.loadFromUrl('<url>') // resizes canvas to to file's size by default
editor.loadFromUrl('<url>', {
size: 'cover'
})
editor.loadFromFile('<File>', {
size: 'stretch'
})
Labels can now be resized from different perspectives.
keepScale
will be accessible as of v2.6.0
and by setting that to false, the default scaling behavior will be disabled.
Also, all options for Konva.Transformer
are available through transformer
The following configuration should be followed to enable resizing from different aspects:
editor.shapes.label.insert({
container: {/* config */},
tag: {/* config */},
text: {/* config */},
config: {
keepScale: false|true, // By setting keepScale to false, the default scaling behavior will be disabled
transformer: {
keepRatio: true, // keepRatio set to true to maintain scaling when scaling from corners
enabledAnchors: ['middle-left', 'middle-right', 'bottom-right'] // Here are all the options available https://konvajs.org/api/Konva.Transformer.html#enabledAnchors__anchor
}
}
})
zIndex export/import is now supported.
Thanks to amanver16, ehussain and kanarelo for their contributions.
Published by raminious over 2 years ago
The new Measurement Tag feature displays the size of a shape when drawing or transforming.
https://pikaso.app/#/core/measurement-tag
To achieve a smoother drawing experience, the logic for drawing SVG paths has been reimplemented.
Pencil Drawings have a minor difference in that, unlike other shapes, they begin a new drawing when the current one ends.
The editor.shapes.pencil.stopDrawing()
method or editor.board.setActiveDrawing(null)
method must be called in order to stop pencil drawing.
Published by raminious over 2 years ago
Shapes can be arranged into multiple groups using the Groups.
The class provides a variety of APIs for working with groups.
Groups Full Documentation
The Snap To Grid feature ensures that objects can be easily positioned in line with any existing objects on the layer. By default, this feature is disabled, but it is easy to enable
Read more
This method destroys all deleted shapes to free-up the memory
This getter method returns the name of the shape
Published by raminious over 2 years ago
autoSelect
option to Drawing settingsPublished by raminious almost 3 years ago
Published by raminious about 3 years ago
editor.board.background.image.isSelectable = true | false
editor.board.background.overlay.isSelectable = true | false
isSelectable
setter/getter to ShapeModel (#22)Published by raminious about 3 years ago
Published by raminious about 3 years ago