Skip to content

Image smoothing as a setting#138

Open
hobbsythe6th wants to merge 7 commits into
Candlestickers:developmentfrom
hobbsythe6th:Image-smoothing-setting-global-implementation-2-assetlib
Open

Image smoothing as a setting#138
hobbsythe6th wants to merge 7 commits into
Candlestickers:developmentfrom
hobbsythe6th:Image-smoothing-setting-global-implementation-2-assetlib

Conversation

@hobbsythe6th

@hobbsythe6th hobbsythe6th commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

I've added image smoothing as a setting, and it works I think. I have very little experience in testing for bugs, so some may be found. This is also a global feature, meaning that as of now you can't (or aren't supposed to) have image smoothing on for one and off for the rest using the setting. Technically the on/off script only runs if you change the setting, and you can still turn smoothing on/off through code, but it's a bit less likely a use case to me so I left it alone.
I don't know if you want to have smoothing in the inspector or not, but it's a bit harder to do that and the global setting, but I'm working (sadly very slowly) on it. That said, I think this is fine for most use cases.
Also I accidentally put the commits from the other pull I made on this pull, and idk what to do. Merge that one first maybe?
Closes #3

a setting. This is global, meaning it adjusts smoothing of ALL images, but inefficient.
Other possible approaches are to index through asset library (same outcome)
and to add two settings buttons in inspector: enable/disable and apply to all.
My opinion is that we should add both options (inspector and global).
@BaronAWC

Copy link
Copy Markdown
Collaborator

Was trying it just now and it seems like the image always reverts back to smoothening after any editor interaction.

I'm not too sure myself on whether a global or image-specific setting is better (it's probably worth a full discussion to decide), but I think it should be a project setting rather than an editor setting at the very least.

@InternetAstronaut

Copy link
Copy Markdown

the image always reverts back to smoothening after any editor interaction

I think the issue is that the option just goes child-by-child changing the path's smoothing property, for this to work as intended it must applied to images being created.

I would also argue that there isn't any good reason to implement such a difficult thing, There haven't been many pixel art animations/games using Wick, and this just feels like implementing for the sake of implementing.

@BaronAWC

Copy link
Copy Markdown
Collaborator

I can say for myself that I've made one pixel art game semi-recently and one pixel art animation waaaaaay in the past. 1x-resolution pixel art would show up blurry, and while I was able to just solve it by exporting at 10x resolution, I do think that an anti-alias option is helpful. It would mean that you can make your pixel art as zoomed in as you want while still looking crisp.

Though thinking about it more, there isn't really a compelling reason to make this an object-specific setting, so a project-wide toggle is probably better.

This will most likely be a 1.1.0 kind of deal so no there's no rush.

@hobbsythe6th

Copy link
Copy Markdown
Contributor Author

Do you have any idea where the bug might be? because I have no ideas at all

@hobbsythe6th hobbsythe6th marked this pull request as draft June 20, 2026 06:14
@BaronAWC

Copy link
Copy Markdown
Collaborator

I'll be busy for a while so I can't look too closely at this for at least a week, and honestly I don't really know off the top of my head either, but I can try tackle it next week.

@hobbsythe6th

Copy link
Copy Markdown
Contributor Author

I think there's two ways to fix this right now: put the on/off code into a loop that runs every time the project renders (which was my v1 for this pr) and the other way is to find what reverts the smoothing to original and disable it (i suspect it is involved with the projectDidChange function but I'm not sure)

Comment thread engine/src/ToolSettings.js Outdated
if (setting.name === "imageSmoothing"){
this.project.getAssets("Image").forEach(asset => {
asset.getInstances().forEach(img => {
img.view.item.smoothing = setting.value

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this doesn't actively apply to newly created GUIElements. You can change in the GUIElement base code to look for this setting.

@StickmanRed

Copy link
Copy Markdown
Collaborator

I think there's two ways to fix this right now: put the on/off code into a loop that runs every time the project renders (which was my v1 for this pr) and the other way is to find what reverts the smoothing to original and disable it

I think the problem is, whenever the project renders, this function (View.Path.js) rebuilds the image from scratch, which reverts the image smoothing setting. So we can move the on/off code to the render function:

    render () {
        if(!this.model.json) {
            console.warn('Path ' + this.model.uuid + ' is missing path JSON.');
            return;
        }

        this.importJSON(this.model.json);

        // Apply image smoothing setting
        if(this.model.pathType === 'image') {
            this.item.smoothing = this.model.project.toolSettings.getSetting('imageSmoothing');
        }

        // Apply onion skin style if Needed
        // ...

@InternetAstronaut

Copy link
Copy Markdown

I think there's two ways to fix this right now: put the on/off code into a loop that runs every time the project renders (which was my v1 for this pr) and the other way is to find what reverts the smoothing to original and disable it

I think the problem is, whenever the project renders, this function (View.Path.js) rebuilds the image from scratch, which reverts the image smoothing setting. So we can move the on/off code to the render function:

    render () {
        if(!this.model.json) {
            console.warn('Path ' + this.model.uuid + ' is missing path JSON.');
            return;
        }

        this.importJSON(this.model.json);

        // Apply image smoothing setting
        if(this.model.pathType === 'image') {
            this.item.smoothing = this.model.project.toolSettings.getSetting('imageSmoothing');
        }

        // Apply onion skin style if Needed
        // ...

LGTM!

@hobbsythe6th

Copy link
Copy Markdown
Contributor Author

for some reason this just makes me worry about the inefficiency, even though I know it's the best way to do it. Thanks so much for the fix! I'll update it soon

@InternetAstronaut

InternetAstronaut commented Jun 29, 2026

Copy link
Copy Markdown

for some reason this just makes me worry about the inefficiency, even though I know it's the best way to do it. Thanks so much for the fix! I'll update it soon

Yes, yes, this method can be inefficient since we're writing to memory every single render with this. Writing to memory may be slow, because writes that take a few microseconds can stack to dramatic performance losses (e.g.: 100 miliseconds), specially when the changed data isn't in the CPU cache.

@hobbsythe6th hobbsythe6th marked this pull request as ready for review June 29, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable image smoothing (setting option)

4 participants