Commit Graph

1140 Commits

Author SHA1 Message Date
Dennis Kobert 366906b956 Add Luma struct (#1154)
* Make Luma usable for MaskImageNode
2023-04-23 19:42:34 +02:00
Dennis Kobert bdc1ef926a Restructure GPU execution to model GPU pipelines in the node graph (#1088)
* Start implementing GpuExecutor for wgpu

* Implement read_output_buffer function

* Implement extraction node in the compiler

* Generate type annotations during shader compilation

* Start adding node wrapprs for graph execution api

* Wrap more of the api in nodes

* Restructure Pipeline to accept arbitrary shader inputs

* Adapt nodes to new trait definitions

* Start implementing gpu-compiler trait

* Adapt shader generation

* Hardstuck on pointer casts

* Pass nodes as references in gpu code to avoid zsts

* Update gcore to compile on the gpu

* Fix color doc tests

* Impl Node for node refs
2023-04-23 10:18:31 +02:00
Keavon Chambers 161bbc62b4 Add the Selective Color adjustment node 2023-04-19 03:02:50 -07:00
Dennis Kobert 76c754d38a Simplify node trait definition (#1146)
* Simplify node trait
2023-04-17 23:42:22 +02:00
Dennis Kobert 1d6c4f13dd 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 9db5ad43bf 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 a1b63811ba Impl byte size function for Color (#1141) 2023-04-17 09:58:21 +02:00
OllieDolan 974a37f127 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 b83f2c24f1 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 15:34:02 -07:00
Christopher Mendoza 4c9ef0fe6c 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 fa23e9d55b 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 f68bc42fc9 Serialize Color as srgb (#1136) 2023-04-16 15:02:22 +02:00
Alexandru Ică b626d39035 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 14:51:33 +03:00
Dennis Kobert ce5b73598c 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 10:15:58 +02:00
Dennis Kobert 37b892a516 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 e21c2fb67b Add SetTransformNode (#1131) 2023-04-15 16:34:17 +02:00
Keavon Chambers 0ba0b2e309 Implement the correct Brightness/Contrast node algorithm (#1130)
Implement correct brightness/contrast algorithm
2023-04-15 05:15:58 -07:00
0HyperCube 0e97f352e9 Serialize images as base64 by rounding channels from floats to u8 (#1120)
Serialise images as base64
2023-04-13 20:03:25 +01:00
Dennis Kobert 79dade24e5 Fix opacity blending on colored brush strokes (#1119)
Make apply opacity function use associated alpha
2023-04-13 10:44:33 +02:00
Christopher Mendoza 951d9912bf Switch nudging from viewport pixels to local pixels (#1114)
Nudging is now based on local pixel dimensions
2023-04-12 11:44:00 -07:00
0HyperCube ed6140b4a7 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 18:50:42 +01:00
Keavon Chambers c7d14c2a7b 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 589ff9a2d3 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 10:35:21 +02:00
0HyperCube 758f757775 Fix the properties when loading a saved document (#1111) 2023-04-11 08:31:03 +01:00
Keavon Chambers ce76dbee6a Rename the Downscale node to Downres 2023-04-09 15:22:22 -07:00
0HyperCube a58d51d685 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 23:30:57 +01:00
isiko 9c4164291c Add the Mask node (#1080)
* Add MaskImageNode

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-04-09 04:56:03 +02:00
Keavon Chambers ea02a2d53a Fix crash upon setting stroke color to none 2023-04-06 18:11:45 -07:00
Keavon Chambers c16ee88b5d Fix some fatal failures related to rendered frame memory size limits 2023-04-02 18:31:41 -07:00
Keavon Chambers 1b50878f3f 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 11:53:12 -07:00
Keavon Chambers 4bdb026d9a Update the website with some new content 2023-04-05 02:34:16 -07:00
Keavon Chambers a74376e224 Prevent browser extensions from recoloring the UI 2023-04-04 18:32:27 -07:00
Keavon Chambers a0a5f02e2a Change the edit icon used in Imaginate 2023-04-03 14:16:46 -07:00
Keavon Chambers 0a9427fe6e 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 d710285029 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 21:15:49 +01:00
Keavon Chambers 92fe0bea50 Bezier-rs: Replace Vue-CLI with Webpack bundler 2023-03-29 16:58:51 -07:00
Keavon Chambers c770cd906e Bezier-rs: Fix visualizing negative curvature on demo site 2023-03-28 17:54:11 -07:00
Keavon Chambers 3cf955e5bb Bezier-rs: Release version 0.2 2023-03-28 12:37:52 -07:00
isiko d0863165a4 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 09:06:24 +02:00
Hannah Li 97be83c404 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 22:58:35 -04:00
Linda Zheng 3733804d18 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 21:05:00 -04:00
Linda Zheng d0ac86b713 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 19:35:57 -04:00
Rob Nadal 3f8adbafba Revert @graphite/ path imports in website (#1095)
Reverted @graphite path imports
2023-03-27 16:39:48 -04:00
Hannah Li c0576ab4e0 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 7e124c8035 Update readme and Task Board links 2023-03-27 11:13:53 -07:00
Sahra Zhou dbcb854cd2 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 d6ab417bcb Code review previous commit, and improve G/R/S hints 2023-03-26 11:49:25 -07:00
0HyperCube 959e790cdf 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 08:03:51 +01:00
Andre Roelofs 639a24d8ad 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-26 01:39:38 +01:00
Keavon Chambers 5c0a075313 Upgrade cargo dependencies (#1090) 2023-03-25 17:29:49 -07:00