Commit Graph

986 Commits

Author SHA1 Message Date
Dennis Kobert
6a6d9cfbc7 Simplify node trait definition (#1146)
* Simplify node trait
2023-04-17 21:42:22 +00:00
Dennis Kobert
e3c38d5eba Bump version of dyn-any to address missues which could lead to ub (#1145)
* Make StaticType trait unsafe

* Mark StaticTypeSized and StaticTypeClone as unsafe as well

* Update dyn-any dependency

* Update manifest links
2023-04-17 23:35:04 +02:00
Keavon Chambers
50105c9a74 Add the Channel Mixer node (#1142)
* Add the Channel Mixer node

* Fix NodeIdentifier not found in Registry

* Add radio toggle for red/green/blue

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-04-17 12:47:24 -07:00
Dennis Kobert
766d146b51 Impl byte size function for Color (#1141) 2023-04-17 09:58:21 +02:00
OllieDolan
d300419f5f Path tool points manipulation: nudging, drag axis snapping, and G/R/S (#1068)
* issue820: implemented nudging points

* nudge points triggered only when the mouse is moved after selecting one point

* issue 820 // bullet 1 done

* grab working / rotate not

* rotate works (sensitive)

* G/R/S and Shift/Drag working

* Cargo formatted // implemented Hypercubes comments

* Refactored G/R/S - need to fix fast transform

* Finished refactored G/R/S

* Typed Angle needs further touch up

* Cargo formatted

* Dealt with dangerous unwraps

* Cargo fmt (again) - unwraps fixed

* Cleaned up

* cargo fmt

* Ready for Review

* Ready for Review- cargo fmt

* Code review fixes

* Remove duplicate constant for nudging

* Fix consts.rs spacing

* Apply suggestions from code review

Added suggestions

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Added typo/grammar suggestions

* Nits

---------

Co-authored-by: Shiro <shiro@damedane.local>
Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-16 15:56:52 -07:00
Christopher Mendoza
3322227086 Change layer duplication so the duplicate is placed above the original (#1124)
Previously, the duplicated layer would be placed at the top of the stack. It is now inserted one layer above the original.

---------

Co-authored-by: Ollie Dolan <olliedolan10@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-16 22:34:02 +00:00
Christopher Mendoza
7cb0c3e789 Change selection to only the duplicated layer (not both layers) when using Ctrl+D (#1118)
* Nudging is now based on local pixel dimensions

* Brush tool live preview (#1116)

* Disable vector preview for brush tool

* Fix brush preview

* Fix warping

* Left and right square brackets to change size

* Add linear interpolation

* Modfiy existing selected brush layer

* Resolve warnings

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Duplicating a layer selects only new layer

* Add Ctrl+J duplicate alias hotkey

---------

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-16 14:42:12 -07:00
Keavon Chambers
4127da823b Update nodes to work with linear color by default (#1135)
* Update nodes to work with linear color by default

* Make tests work in linear not gamma
2023-04-16 12:20:44 -07:00
Dennis Kobert
95a4f1ed5e Serialize Color as srgb (#1136) 2023-04-16 15:02:22 +02:00
Alexandru Ică
8fb663bad1 Add the image segmentation node (#1122)
* Add image segmentation node

This is a node which receives as input:
- An image.
- A mask, which consists of colors that define the image segments.

Each unique color in the mask defines an area where a segmen resides.
The node generates a `Vec<ImageFrame>` where the length of the result
is the number of unique colors in the mask.

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Add the Index node for image segments

Since the output of the image segmentation node is a `Vec<ImageFrame>`,
we want a way to access the segments individually. The Index node receives
a `Vec<ImageFrame>` as input and an index, and returns the image found
at that index in the vec.

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Integrate the image segmentation and index nodes into the editor

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Initialize the input of the index node with an empty image frame

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Don't expose the parameter for the index node

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Don't crash the editor when the number of segments exceeds the accepted limit

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Print a warning in the console when the number of segments exceeds the accepted limit

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Add a few more checks so that the editor doesn't crash on invalid input

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Replace the tagged value for the index node

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Fix merge conflicts

---------

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-04-16 11:51:33 +00:00
Dennis Kobert
e84a81ca56 Fix transform logic for mask node (#1134)
Fix transform logic for mask node + other fixes

* Fixes the transform logic for the mask node reverting the breakage
introduced by the color pr

* Actually modifies the pixel values

* Fix storage format for images

* Export images as unassociated alpha
2023-04-16 08:15:58 +00:00
Dennis Kobert
59db45bb36 Color system based on traits, and conversion to linear color in the graph (#1123)
* Migrate Nodes to use RasterMut + Samplable

* Add Pixel trait to include serialization

* Implement traits for Color and propagate new generics

* Always convert to linear color when loading images
2023-04-16 02:57:05 +02:00
Dennis Kobert
e4d4f4ad68 Add SetTransformNode (#1131) 2023-04-15 15:34:17 +01:00
Keavon Chambers
b133fc7feb Implement the correct Brightness/Contrast node algorithm (#1130)
Implement correct brightness/contrast algorithm
2023-04-15 05:15:58 -07:00
0HyperCube
e60e621aae Serialize images as base64 by rounding channels from floats to u8 (#1120)
Serialise images as base64
2023-04-13 12:03:25 -07:00
Dennis Kobert
49330fef19 Fix opacity blending on colored brush strokes (#1119)
Make apply opacity function use associated alpha
2023-04-13 01:44:33 -07:00
Christopher Mendoza
07b3eba136 Switch nudging from viewport pixels to local pixels (#1114)
Nudging is now based on local pixel dimensions
2023-04-12 12:51:59 -07:00
0HyperCube
f271964bf8 Brush tool live preview (#1116)
* Disable vector preview for brush tool

* Fix brush preview

* Fix warping

* Left and right square brackets to change size

* Add linear interpolation

* Modfiy existing selected brush layer

* Resolve warnings

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-12 12:51:39 -07:00
Keavon Chambers
69f6ed3a11 Fix Levels and Exposure adjustment nodes (#1112)
* Step Imaginate resolution by 64

* Fix the Exposure node

* Change comments and variable names
2023-04-11 01:52:44 -07:00
Dennis Kobert
7c03360c0a Implement the Brush tool (#1099)
* Implement Brush Node

* Add color Input

* Add VectorPointsNode

* Add Erase Node

* Adapt compilation infrastructure to allow non Image Frame inputs

* Remove debug output from TransformNode

* Fix transform calculation

* Fix Blending by making the brush texture use associated alpha

* Code improvements and UX polish

* Rename Opacity to Flow

* Add erase option to brush node + fix freehand tool

* Fix crash

* Revert erase implementation

* Fix flattening id calculation

* Fix some transformation issues

* Fix changing the pivot location

* Fix vector data modify bounds

* Minor fn name cleanup

* Fix some tests

* Fix tests

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2023-04-11 01:40:54 -07:00
0HyperCube
67faa2f278 Fix the properties when loading a saved document (#1111) 2023-04-11 00:31:03 -07:00
Keavon Chambers
4e8b8cc7d1 Rename the Downscale node to Downres 2023-04-09 15:38:36 -07:00
0HyperCube
4a39a94534 Add cache clearing to stop the memory leak (#1106)
* Add cache clearing

* Add TODO comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-09 22:30:57 +00:00
isiko
8677981ceb Add the Mask node (#1080)
* Add MaskImageNode

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-04-08 19:56:44 -07:00
Keavon Chambers
9e8ac42a82 Fix crash upon setting stroke color to none 2023-04-06 18:11:45 -07:00
Keavon Chambers
3878132dbe Fix some fatal failures related to rendered frame memory size limits 2023-04-06 17:01:55 -07:00
Keavon Chambers
05e5be3200 Prevent rendering when transforming frame layer
Reduces confusion from rendering lag and lessens the opportunity to build up leaked memory from the present lack of node graph cache eviction
2023-04-06 16:59:10 -07:00
Keavon Chambers
0d6d498480 Update the website with some new content 2023-04-05 02:34:16 -07:00
Keavon Chambers
c22fa8dcae Prevent browser extensions from recoloring the UI 2023-04-04 18:32:27 -07:00
Keavon Chambers
8512bc1271 Change the edit icon used in Imaginate 2023-04-03 14:16:46 -07:00
Keavon Chambers
65d705abc7 Polish node graph frames and rename them for clarity (#1104)
* Polish layer panel UI and layer type icons/text

* Assorted UI text and comment cleanup

* Insert Transform node before Imaginate node via tool

* Rename "Node Graph Frame" to Layer type and Frame tool

* Rename "Node Graph Frame" to "Frame" tool

* Update Node Graph Frame -> Frame tool icon

* Fix lint warnings
2023-04-03 01:52:25 -07:00
0HyperCube
14cf7bef31 Fix regressions introduced in the vector nodes migration (#1100)
* Fix double click to enter path tool

* Fix error

* Fix transform bug

* Fix squaring scale on images

* Shift node position and refresh graph

* Downscale node seperate

* Fix mirror

* Remove duplicate transform

* Always show node graph

* Correctly set freehand and spline tool positions

* Run cargo format

* Maybe fix the scale

* Downscaled image is always smaller than origional

* Fix one crash

* Don't show node graph on welcome screen

* Reduce default graph panel height

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-31 13:15:49 -07:00
Keavon Chambers
78116f305e Bezier-rs: Replace Vue-CLI with Webpack bundler 2023-03-29 18:24:22 -07:00
Keavon Chambers
93bd17e747 Bezier-rs: Fix visualizing negative curvature on demo site 2023-03-28 17:54:11 -07:00
Keavon Chambers
adb7eea065 Bezier-rs: Release version 0.2 2023-03-28 13:04:51 -07:00
isiko
7d1a8860ff Add Range parameter to the Threshold node (#1079)
* Add Range

* Naming, order, and defaults

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-28 00:06:24 -07:00
Hannah Li
d1630c73de Bezier-rs: Implement miter-limit (#1096)
* Implement miter-limit approximation

* Refactor to use Join enum and address other comments

* Rustdocs improvements

* Tweaks

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-27 19:58:35 -07:00
Linda Zheng
f49e62a51c Bezier-rs: Add lookup table function for subpath and make it support euclidean parameterization (#1082)
* Add euclidean option for lut

* Add lut for subpath

* Fix rust formatting

* Fixed breakages caused by UI updates

* Code cleanup

* Make ProjectionOptions optional

---------

Co-authored-by: Rob Nadal <robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-27 18:05:00 -07:00
Linda Zheng
508726d73f Bezier-rs: Add curvature and rotate functions to subpath (#1081)
* Add rotate and curvature

* Fix comments

* Fix case where curve is linear

* Address comments

* Fixed breakages caused by UI updates

* Scootch rotation point to center in frame

* Code review

* Visualize t value point when segment is linear

---------

Co-authored-by: Rob Nadal <robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-27 16:35:57 -07:00
Rob Nadal
e24b5251f7 Revert @graphite/ path imports in website (#1095)
Reverted @graphite path imports
2023-03-27 13:39:48 -07:00
Hannah Li
93821f3e3b Bezier-rs: Add joins and caps to offsets and outlines (#1083)
* Intial work

* Improve miter and add round join

* Get arcs to go opposite direction

* Add cap and other refactors

* Rename joint to join, fix some bugs

* Fix single point issue

* Clean up

* Fix iframe sizes and update UI

* Address comments and handle single point outline

* Rename variables, fix branches in outline

* Address comments
2023-03-27 16:25:08 -04:00
Keavon Chambers
2291442186 Update readme and Task Board links 2023-03-27 11:13:53 -07:00
Sahra Zhou
71173341df Fix crash when scaling something with 0 width or height (#1078)
* resolve NaN value when trying to change scale value from zero to other numbers

* resolve NaN value when trying to change scale value from zero to other numbers

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-26 15:20:00 -07:00
Keavon Chambers
eac301d6f0 Code review previous commit, and improve G/R/S hints 2023-03-26 11:50:00 -07:00
0HyperCube
ac49519fa9 Migrate vector data and tools to use nodes (#1065)
* Add rendering to vector nodes

* Add line, shape, rectange and freehand tool

* Fix transforms, strokes and fills

* Migrate spline tool

* Remove blank lines

* Fix test

* Fix fill in properties

* Select layers when filling

* Properties panel transform around pivot

* Fix select tool outlines

* Select tool modifies node graph pivot

* Add the pivot assist to the properties

* Improve setting non existant fill UX

* Cleanup hash function

* Path and pen tools

* Bug fixes

* Disable boolean ops

* Fix default handle smoothing on ellipses

* Fix test and warnings

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-26 00:03:51 -07:00
Andre Roelofs
5759600f95 Replace TS relative @ import path (#1087)
Migrated the import shortcut used in Svelte from @ to @graphite for better future package compatibility

Co-authored-by: Andre Roelofs <andreroelofsai@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-25 17:39:38 -07:00
Keavon Chambers
f910b45a5b Upgrade cargo dependencies (#1090) 2023-03-25 17:29:49 -07:00
Keavon Chambers
7aa355f62f Add Imaginate help docs link to UI 2023-03-25 01:04:58 -07:00
Keavon Chambers
ae2369ef77 Update website mockup images 2023-03-22 09:35:32 -07:00
Keavon Chambers
4645cdf3f0 Skip showing auto-save document old version error 2023-03-21 09:18:28 -07:00