Skip to content

Conversation

@Joeclinton1
Copy link
Member

@Joeclinton1 Joeclinton1 commented Sep 20, 2025

Resolves #8563

Changes

image

Video demo

2025-12-05.19-39-27.-.Trim.mp4

Adds:

  • A palette which is persistent through data stored in comments. You can create palettes that are project wide and then assign them to costumes. You can add colours, edit colours, delete colours from palette.
  • Import palettes from text, GBL or from images. export to text.
  • When you use a colour not in the palette it's auto added to the palette
  • New brush selector ui with 1-4 pixels instead of slider, specific to pixel art
  • Checkerboard square is 1px sized instead of 8px for easier pixel art
  • Canvas be resized to any size, defaulting to 32x32, making it easier to work within a specific sprite size.
  • Editing the canvas when the canvas is bigger than your current costume does not cause it resize in pixel mode (done by overriding the cropping step when the bitmap is updated)
  • imported bitmap files, are auto halved in size so that 1px in the bitmap image remains 1 px in the canvas
  • a button "pixel mode" for enabling the pixel specific features. Pixel mode only applies to bitmaps.
  • setting "New paint costumes are bitmap by default"
  • Animation preview pane that will show an animation of your current sprite's costumes at a given fps. Allows changing range of costumes via a togglable dropdown. Animation pane is floating and dragabble.
  • Adapts to small screens by floating the palette pane.
  • Default text size is resized proportional to the size of the canvas, to make working with text in pixel mode easier.
  • Dynamic enable/disable supported

Reason for changes

Could help introduce kids to pixel art, and provide a strong built in editor to reduce time spent making art outside scratch and having to import in.

Tests

See the below TODO for bugs that were found and fixed. At this point I am not aware of any bug which is why I need your help to test it, and find ways of using it I didn't consider that lead to bugs.

Todo

  • Fix bug where the brush size input doesn't get hidden if it hadn't rendered yet when brush mode changes
  • Fix bug where default brush size starts at 10 instead of 1 and our brush shape isn't selected
  • Fix bug where the Select tool in pixel mode, rather than top left to bottom right is shift so that top left starts at middle of box and the new middle is where top right was.
  • Fix bug where after selecting in pixel mode clicking outside canvas does not deselect the canvas
  • Fix bug where the select tool can select the border and move/resize it.
  • Fix bug where after duplicating a costume (or dragging to new costume) it halves the costume size
  • Fix bug where in vector mode the canvas outline is incorrectly being resized.
  • Fix bug where imported costumes are twice as big as they should be until we change costume and change back.
  • Fix bug where swapping from vector mode to bitmap causes the canvas and border to resize to half the actual size until canvas is scrolled
  • Fix bug where the border is half a pixel on all sides larger than it should be
  • Fix bug where switch tabs makes either animation preview or palette disappear
  • Make it so that palette map is by name not md5, and that changing costume name updates palette map
  • Make so that new colours are auto added to palette, if not already in palette
  • Make the palette upload/download button have better contrast
  • Improve palette style for small screens
  • Add info to addon settings explaining the shift and right click controls for editing and deleting colours from palette
  • Add warning to addon settings that imported costumes will be half as big so needs 200% looks effect size
  • Changes to addon settings need to refresh immediately not on reload
  • Disabling should unhook everything
  • (Nice To Have) A preview animation pane, that cycles through your costumes at a given frame rate to show the animation so far
  • (Nice To Have) Export costumes as gif with a given frame rate.
  • (Nice To Have) Make default text size smaller proportional to canvas size
  • Make the animation preview always be floating pane and palette to have max height.
  • Make animation preview have a range.
  • Prevent auto resizing when in pixel mode

  • Directly override bitmap raster trimming instead of using the two corner pixel method, as it prevents resizing smaller than the original size, leaves pixels left over that will collect over time, and also because of opacity doubling when costume loads the pixels become visible. Also add a setting for this in case users still want auto resizing.
  • Fix bug where resizing the canvas is getting overridden by the default size
  • Fix extra spacing even when hidden ui issue which causes problems when other toolbar addons are enabled
  • Fix bug where fill tool fills entire 480x360 canvas instead of the new fake one.
  • Add a pause play button to animation preview
  • adjust zoom to always resize to the new canvas
  • make the default canvas size resize to a larger costume, with behaviour togglable by setting
  • Store the last created canvas in memory instead of rebuilding to reduce lag when changing costume.
  • remove mentions of scratch addons, in the storage comments.
  • Adjust icons for import, export to fit scratch's convention
  • Capitalize all words in tooltips
  • Fix bug where resizing the canvas is only visual until we draw on the canvas, should take effect immediately on canvas size change.
  • resize to canvas should always resize, it shouldn't stop after first time resizing canvas
  • Make it so default new paint costumes are default costume size sized.
  • Fix bug where odd sized vertical canvases have a gltiched row first row that slants down
  • Fix bug where every other attempt to resize canvas is ignored
  • Fix bug where if you draw something larger than canvas and swap to pixel mode the drawing gets offset.
  • Fix bug where if you resize canvas to be smaller than current drawing it will let the user do this and then just offset the drawing when it should simply revert the canvas size with no changes.
  • Fix bug where palette mapping comment appears before pixel art tool is used and even after dynamic disable
  • Fix bug where first switching to costume and then on backdrop switching to backdrop crashes Scratch

Joeclinton1 and others added 30 commits September 16, 2025 23:02
@Joeclinton1
Copy link
Member Author

I have a few thoughts on the UI. Could the pixel mode button be moved next to the convert to vector/bitmap button with visual state indicator such as changing the label or using a checkbox? The buttons would also look better if they use the same height as the rest of the footers's elements.

Also, it seems a bit strange to have a different brush size UI between the bitmap and pixel modes.

I'll adjust the ui of pixel mode button.

The different brush ui is to align with existing pixel mode editors and will not be changing as I like it.

@Joeclinton1
Copy link
Member Author

@Samq64 what do you think of an icon representing the pixel mode ( 3x3 squares for example) that is turned on off like the onion skin one. instead of the words "pixel mode"

@Joeclinton1
Copy link
Member Author

Joeclinton1 commented Dec 8, 2025

Another bug:

  1. With pixel mode off draw something that extends past its canvas
  2. Switch to pixel mode
  3. Draw something
  4. When the mouse lifts the canvas toggles between the 2 sizes

So there are other ways to get pixels to extend beyond the canvas, such as simply resizing the canvas. I cant get it to toggle between sizes, but I can get it to offset the pixels which is a bug. I'm out of time today, but will come back to fix this next week.

Copy link
Contributor

@pufferfish101007 pufferfish101007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small things that I noticed, as someone who generally doesn't do visual art (but this addon might convince me to):

  • I would like to be able to pause and play the animation preview. Having it constantly playing is incredibly distracting for me, but I don't necessarily want to have it permanently disabled and then enable it through the addon settings when needed. But it's not massively inconvenient either; just a quality of life thing.
  • The default zooming behaviour seems a bit strange - if I create a new vector costume that is zoomed out all the way, as is the default I think, then enable bitmap and enable pixel mode, it is incredibly zoomed out. Video:
2025-12-08.16-50-13.mp4
  • It seems strange to me that if I enable pixel mode on a pre-existing costume, the canvas doesn't scale appropriately to encompass that costume, instead just defaulting to 32x32 (or whatever is specified) no matter what - kind of understandable behaviour, but not necessarily intuitive
  • There's quite a noticeable stutter when changing from a pixel costume to a vector costume. This stutter exists without the addon enabled but is quite a bit worse with the addon enabled; pixel -> vector is the most stuttery (compared to bitmap->vector, vector->bitmap, vector->pixel). I don't know if there's anything that can be done about this, and if there is, it's the sort of thing that can probably be done in a subsequent release. Video:
2025-12-08.16-58-02.mp4

I tried to break things by changing the palette storage comments, but couldn't break anything, which is great!

@Joeclinton1
Copy link
Member Author

Joeclinton1 commented Dec 12, 2025

I have solved most of the bugs but those last 2 I just can't seem to figure out:

Fix bug where if you draw something larger than canvas and swap to pixel mode the drawing gets offset.
Fix bug where if you resize canvas to be smaller than current drawing it will let the user do this and then just offset the drawing when it should simply revert the canvas size with no changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new addon Related to new addons to this extension. `scope: addons` should still be added. scope: addon Related to one or multiple addons

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Addon: Pixel Art tools

5 participants