Skip to content

Paint in place master#284

Open
Gaurav0 wants to merge 68 commits intomasterfrom
paint-in-place-master
Open

Paint in place master#284
Gaurav0 wants to merge 68 commits intomasterfrom
paint-in-place-master

Conversation

@Gaurav0
Copy link
Member

@Gaurav0 Gaurav0 commented Jan 20, 2026

This is based on #230 by @cdvv7788 with updates also by @jrconway3

I am not super familiar (or familiar at all) with this WebGL stuff but basically it goes like this:

Select one of the parts we are going to be recoloring dinamically (for now only the pieces that are tied to the body color as they seem to be using the same palette)
Create a canvas with a webgl context (shared - expensive operation performed once)
Initialize a recolor cache
Download the base variant for the asset (light)
Apply recolor in the webgl canvas.
Copy to an output webgl canvas so we can reuse the shared one for the next drawing.
Copy to a 2D context canvas we have offscreen. This is then copied once again to the preview canvas, and is the one used for downloads and stuff.
With CPU pixel by pixel it takes 190ms-230ms. With GPU it takes around 90ms-130ms.
The improvements are there and seem to be working. I may not be using the optimal setup tho.

cdvv7788 and others added 30 commits October 13, 2025 20:03
…al-LPC-Spritesheet-Character-Generator into paint-in-place-for-real
@Gaurav0 Gaurav0 added enhancement New feature or request refactor changes internal implementation labels Jan 20, 2026
@Gaurav0 Gaurav0 mentioned this pull request Jan 20, 2026
@cdvv7788
Copy link
Contributor

My favourite part of the PR, but probably the most problematic one, is the sheer size. Maybe we can remove the files later, and focus on the code changes only in here. We already have an estimation about the huge savings in space, which was my initial intention with the PR.

@jrconway3
Copy link
Contributor

My favourite part of the PR, but probably the most problematic one, is the sheer size. Maybe we can remove the files later, and focus on the code changes only in here. We already have an estimation about the huge savings in space, which was my initial intention with the PR.

Yeah I'm in agreement with this. It'd be better to skip removing all the files for later. That's something we can clean up later on down the line.

@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for liberatedpixelcup ready!

Name Link
🔨 Latest commit 98fbc49
🔍 Latest deploy log https://app.netlify.com/projects/liberatedpixelcup/deploys/69aef9dc4467e60008c825b4
😎 Deploy Preview https://deploy-preview-284--liberatedpixelcup.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jrconway3
Copy link
Contributor

I found a commit that seems to contain all the deletes:

git revert 0ec53ba0ca75fa5fde87046d173e211514cf8128

I ran this and pushed, and now I only see 90 changes. Hopefully that single commit only had image deletions like it implies. I didn't see any weird conflicts there when reverting that one commit.

JaidynReiman and others added 11 commits February 23, 2026 12:45
* #273 Split per frame

## Changes
- added `Split per frame` button which downloads individual frames grouped in folders (up,down,left,right) which are then grouped in anims.

* #273 Reading canvas - using willReadFrequently

## Fixes
Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

* #273 exportIndividualFrames - improve performance

* cleanup: don't generate old-version index.html in generate-sources

* fix button text

* replace ospec with mocha; update test framework to use esm

* Issue #287 Remove Source Index by Restructuring Sheet Definitions to Generate the Category Tree Layout (#289)

* * Issue #287 Refactored Sheet Definitions Directory Structure

* * Issue #287 Supported Recursive Directory Searching for Item Metadata

* Removed EOF Linebreak

* * Cleaned Up Sheet Definition Structure, Added Missing Meta Files, Added Required and Animations to Meta Files

* * Finished Refactoring Generate Sources, Added Label to Tree Node, Added Required to Tree Node Categories

* * Fixed Wings, Lizard, Tail Structures

* * Generated Metadata for Cleaned Up Wings/Tails

* * Sorted File Lists Before Generating

* * Sorted Files Before Parsing to Prevent Different OS From Parsing the Files in a Different Order

* * Defined Empty QueryObj and TreEPath

* * Reverted Line Endings Channge

* * Organized Heads Into Subcategories

* * Generated New Metadata

* * Issue #287 Fixed Body Color Not Displaying By Default, Placed Body Color Under Body > Bodies for cleaner organization

* * Sorted CSV Results

* * Fixed Lint Failure

* fix line endings

* cleanup generate_sources.js

* * Removed QueryObj Var, Added Split to ItemPath/TreePath again (only use TreePath for now)

* * Added Compatibility to Categories, too

* * Removed Debug Console Log

* extract filter related methods from state.js

* fix animation missing errors

* * Fixed Broken Replacements

---------

Co-authored-by: JaidynReiman <jaidyn@jaidynreiman.net>
Co-authored-by: Gaurav Munjal <gaurav.munjal@civicplus.com>

* move SearchControle test file

* configure chai for easier debugging

* add tests for BodyTypeSelector component

* add tests for FiltersPanel component

* add tests for AnimationFilters

* add tests for LicenseFilters

* whitespace fixes

* reduce some boilerplate

* format sources/canvas/download.js

* add tests for drawTransparencyBackground

* add tests for drawFrameToFrame

* add tests for downloadFile

* add tests for downloadAsPNG

* add tests for canvas/load-image.js

* add tests for applyTransparencyMaskToCanvas

* add tests for utils/helpers.js

* add tests for utils/fileName.js

* case insensitive hash matching

* tests for state/hash.js

* fix whitespace in state/hash.js

* copilot review suggestions

* * Issue #302 Fixed Body zPos, Fixed Generating z_positions.csv

* * Fixed Keeping Same Position in Parse ZPos

* * Re-Generated Sources

* tests for state/filters.js

* * Fixed Sorting Without Locale

* * Removed Debug Code Accidentally Committed From Different Issues

* * #302 Fixed Locale Compare Using Specific Locale (en)

* Fix header overlapping on columns-container

* * Issue #290 Fixed Exporting Custom Animations With Split FG/BG Layers

* * Added Alternate File Name Spec Tests

* Bump qs from 6.14.1 to 6.14.2

Bumps [qs](https://github.com/ljharb/qs) from 6.14.1 to 6.14.2.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.14.1...v6.14.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-version: 6.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* * #311 Fixed Bug Where BG Frame Was Placed as FG Frame for XLong Wavy Sit (#312)

Co-authored-by: JaidynReiman <jaidyn@jaidynreiman.net>

* Bump ajv from 6.12.6 to 6.14.0

Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.6 to 6.14.0.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](ajv-validator/ajv@v6.12.6...v6.14.0)

---
updated-dependencies:
- dependency-name: ajv
  dependency-version: 6.14.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jernej Habjan <jhabjan@marinexchange.com>
Co-authored-by: Gaurav Munjal <gaurav.munjal@civicplus.com>
Co-authored-by: Gaurav Munjal <Gaurav0@aol.com>
Co-authored-by: JaidynReiman <jaidyn@jaidynreiman.net>
Co-authored-by: Luke Fernando <luke@vlte6.dns.slt.lk>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Merge master into paint-in-place-master again
* * Configured Palette Definitions for Paint in Place System

* * Rethinking Palette Config

* * Added Theorycraft Recolors Section for Sheet Definitions

* * Renamed Palette  Files

* * Fixed Recolors Section for Heads

* * Refactored Sheet Definitions Recolors Layout Again

* * Configured Sheet Definitions Recolors

* * Updated JSON Palette Config

* * Fixed To No Longer Break Before Loading Page

* * Fixed Palette Naming Conventions

* * Renamed Palette Files

* * Added Palette Data and Full Recolor Data to ItemMetadata

* * Issue #287 Refactored Sheet Definitions Directory Structure

* * Issue #287 Supported Recursive Directory Searching for Item Metadata

* Removed EOF Linebreak

* * Cleaned Up Sheet Definition Structure, Added Missing Meta Files, Added Required and Animations to Meta Files

* * Finished Refactoring Generate Sources, Added Label to Tree Node, Added Required to Tree Node Categories

* * Fixed Wings, Lizard, Tail Structures

* * Generated Metadata for Cleaned Up Wings/Tails

* * Sorted File Lists Before Generating

* * Sorted Files Before Parsing to Prevent Different OS From Parsing the Files in a Different Order

* * Defined Empty QueryObj and TreEPath

* * Reverted Line Endings Channge

* * Organized Heads Into Subcategories

* * Generated New Metadata

* * Merged Sheet Definition Conflicts

* * Added Palette Constants to Meta Palette Files

* * Refactored Palette Metadata to Include Information on Palette Versions & Materials In Metadata Instead of Constants

* * Issue #287 Fixed Body Color Not Displaying By Default, Placed Body Color Under Body > Bodies for cleaner organization

* * Sorted CSV Results

* * Fixed Lint Failure

* fix line endings

* cleanup generate_sources.js

* * Removed QueryObj Var, Added Split to ItemPath/TreePath again (only use TreePath for now)

* * Added Compatibility to Categories, too

* * Removed Debug Console Log

* extract filter related methods from state.js

* * Issue #234 Added Recolor Support to Generate Sources

* * Made Variants Optional on Generate Sources, Set Animation as Default Global Before Variants

* * #234 WIP Added New ItemWithRecolors Node (Unfinished)

* * Split Defaults in Meta Palettes, Fixed Eye Key Issue, Removed Source From All LPCR

* * Rewrote Palette Metadata for Items to Make Variants Easier

* * Added Support for Palette Variants to Hash

* * Minor Palette / Asset Metadata Changes

* * Fixed Rewriting How Palette Recolors Works With Palette Metadata

* * Partially Configured Recolors Node

* * Fixed Apply Match Body Color Also Matching Recolor

* * Added Labels for Eyes

* * Fixed Modal Issues, Separated Modal Into Its Own File

* * Configured Recolor Modal, Selecting Recolor From Modal and Replacing Recolors on Assets Where Viable

* * Fixed Supporting Multiple Colors on Some Assets

* * Fixed Supporting Multiple Colors on Some Assets

* * #234 Supported Multiple Recolors Per Asset

* * Removed Variants in Faces, Fixed ReplaceinPath Error on Palettes Issues

* * Addressed Lint Errors

* * Removed Eye Color Options From Faces

* * Fixed Apply Match Body Color Also Replacing Subcolors (the subcolor MUST have matchBodyColor as well)

* * Removed Eye Color Variants

* * Replaced Body Color Variants With Palette Selection

* * Fixed Allowing All Previews of Same Asset to Replace Color

* * Don't Include Variants in Credits

* * Don't Include Variants in Credits

* * Adjusted Palette Selection Dimensions to Appear Left of the Modal on Wider Screens

* * Issue #234 Fixed Ability to Set Custom Source Palette, Fixed Faces Not Recoloring Eyes

* * Fixed Variants Not Recoloring Properly

* * Fixed Checking Recolor Names in replaceInPath

* * Fixed Updating Preview Site on paint-in-place-master

* * Added Lint and Site Sources to paint-in-place-master

* * Don't Close Modal on Selecting Color

* * Implemented Copilot's Suggested Fixes

* * Fixed Errors Caused by Custom Set as Base Color

* * Fixed Recolor Issues With Base Palettes, Fixed Eyes Not Properly Setting on Right Frame

* * Fixed Palette Options Returning Body Color if No Selection Available

* * Fixed Eyes Applying to All Items With Eyes as Subcolor

* * Fixed Lint Error: Missing GetMultiRecolors

* * Fixed Issue With Eyes Using Body Color If No Color Set

* * Fixed Load Selections From Hash Test Failures

* * Issue #234 Fixed Neutral Expression Not Matching Default Color Correctly, Replaced eye.ulpc with ulpc

* * Added Hash-Related Recolor Tests

* * Removed Unneeded Comment

* * Removed Compact Display Height/Width

* * Removed Skipped Entries Comment

* * Made Several of Guarav's Suggested Fixes

* * Fixed Match Body Color Failing On Initialize Load (first selection made after loading editor)

* * Removed Commented Out Variants From Credits

* * Added Sort Directory Tree to Generate Sources

* * Created Unified Select Item

* * Removed Unused State Methods From ItemWithREcolors

* * Removed Outdated Eyes Child, Fixed Recolor Label Backup

* * Recompiled Without Eye Child

* * Reorganized Style Sheets, Moved All ItemWithRecolors Styles to recolors.css

* * Made BoolMap A Constant Again

* * Replaced .path with .parentPath on Dirent Calls

* * Addressed More Copilot Issues

* * Fixed Missing Var err

* * Removed Falsely Duplicated Ear Sheets, Added Base Assets for Furry Ear Skintones and Wrinkles

* * Removed Variants For All Remaining Body/Skintone Assets

* * Moved Skintone Asset Directories

* * Fixed Selected Colors Area if Asset Type Name Doesn't Exist in Current Selections

* * Replaced Sheep, Rat, Rabbit, Mouse Base Head Palette Colors

* * Fixed Default Palette for Boarman, Replaced Default Heads for Mouse, Rabbit, Rat, Sheep

* * Updated Credits for Mouse, Rabbit, Rat, Sheep Head to Include Napsio and JaidynReiman

* * Replaced Base Assets for Sheep, Rat, Rabbit, and Mouse Child

* * Fixed Child Head Default Colors and Credits

* * Fixed Merge Conflict Issues

* * Fixed Copilot Suggestions

* * Fixed BoolMap Incorrect Valyues

* Revert "* Removed Falsely Duplicated Ear Sheets, Added Base Assets for Furry Ear Skintones and Wrinkles"

This reverts commit f33d51b.

* * Reverted JSON File Variant Removals Change

* * Added Wrinkles, Adult Wolf/cat Ear Skintones Back

* * Reverted Path Directories on Wolf/Cat Ear Skintones

* * Re-Added Missing Child Wolf/Cat Skintones

* * Addressed Two New Copilot Comments

* * Merged Master

* * Issue #234 Added Fixes for Gaurav

* * Removed Comment on path: itemPath

* * Removed ItemPath Vars

* * Fixed Compact Display Errors

* * Fixed Copilot Comments

* * Issue #234 Implemented Modal With Image Previews

* * Added Missing Root View Node

* * Asked Copilot How to Properly Reload Canvases Instantly on New Modal

* * Removed Strong Violence

* * Removed Unused Replace in Path

* * Recolor Modals Keep Color Changes and Only Replace The Color Matching the Modal Itself

* * Removed Most Inline Styles

* * Made Some Changes, Removed Inline Styles, Moved recolors.css to index.html

* * Implemented Collapsible Categories in the Modal

* use a grid for the modal

* * Fixed Some Selections Not Loading on All LPCR Colors, Made Other Minor Adjustments, Fixed Opening Modal When Clicking on Preview

* * Fixed De-selecting Subcolors

* * Removed Unnecessary Semicolon

* * Fixed Cleaning Up Log Details

* * Asked Copilot to Find Better Solution

* * Cleaned Up Minor ISsues

* * Added LoadSelectionsFromHash Profiler

---------

Co-authored-by: JaidynReiman <jaidyn@jaidynreiman.net>
Co-authored-by: Gaurav Munjal <gaurav.munjal@civicplus.com>
@jrconway3
Copy link
Contributor

When I created this:
#284

I tried to deselect a furry ear skintone and it didn't work:
image

I look forward to when I can connect that up and make it a subcolor. In the meantime I guess I'd better fix it.

@jrconway3
Copy link
Contributor

Right now eye deselect works but not the default. I was certain I tested both after I fixed secondary color deselect.

Co-authored-by: JaidynReiman <jaidyn@jaidynreiman.net>

IDK why I opened a PR when I should just straight up merge it lol.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor changes internal implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants