# Bug with paint editor

just see this project

bug with paint editor by gego51 - Snap! Build Your Own Blocks (berkeley.edu)

I would use paint editor to create a lot of texture for my project, finally, I use scratch 1.4 for to replace white color with translucent

Yes. This is a known bug we inherit from Javascript, which is dithering (softening edges) to avoid jaggies. Unfortunately in your picture all the edges are horizontal or vertical so there wouldn't be any jaggies even without dithering, but it happens anyway. If I had my druthers we wouldn't rely on JS's drawing functions at all but would compute each pixel ourselves. Jens tells me we can't do that. :~(

Would

bool CanvasRenderingContext2D.prototype.imageSmoothingEnabled


help? It disables image smoothing/antialiasing/uses nearest neighbor when drawing an image.

???
Canvas context for drawing images can be configured to disable smoothing.
I made, once, a Snap version without smoothing. There were two problems.

1. Project must be built from the ground with smoothing disabled. Without it images started to degrade right after being dragged to the "Costumes" panel and stored damaged within a project.
2. There is no way to disable smoothing for pen operations (PenTrails). Some substitutions should be invented, like direct image data manipulation https://github.com/sch/crisp-canvas.

I dont know if jens have seen my last reply in github after closing my issue, but I have a message for his if not :

"I do not ask for a professional image software integrated in Snap, just a simple and intuitive tool like in Scratch first name, imagine the child, he gets tired to make a drawing for his project with the Snap tool! , or he imports one on the library, he doesn’t like the color of the jeans of the drawing, he will then click on the bucket to change the color of the jeans, and he sees that it has cropped the contour, and the he realizes that it does not go as he wants, I do not ask that you do Snap! a professional editor but fix a problem that harms the intuitiveness of Snap!
a child will not open 30000 program just to modify an image, the fill that alters the other colors, it is not intuitive for children, a lack of zoom in the tool, it is not intuitive

"

My probably-naive idea about this is that we should keep two copies of every image, including costumes and pentrails: one without dithering that's used to compute things like floodfill, touching, etc., and one with dithering that's generated from the undithered one when something is actually displayed. That way, dithering errors wouldn't accumulate over repeated editing operations, but the user wouldn't see jaggies.

Jens will kill me for saying this, but maybe one or both of you should file a PR. Improving the paint editor is probably something we'll never get around to, even though we all agree it's needed. Just make sure to follow the jshint instructions in the CONTRIBUTING.md thingy. And be prepared for Jens to refuse to pull it. (We are both already mad at each other right now so I'm not being as tactful about this as I'd usually be.) (No, I'm not going to talk about what we're mad about.)

There is a preliminary Scratch Costume Editor as a user project. It stiil does not have direct costume transfer and load js from my github account (I need a quiet evening to finish it) but may be usable with disk save/load.

Just wow !

We hope it's coming soon!

Just to be clear, it is only shameless copy of original Scratch editor (by LLK, https://github.com/LLK) .
Available as standalone
https://llk.github.io/scratch-paint/

That's what I thought, but it's wonderful that we can use it in snap ...

awesome