Discuss Scratch

ihgfedcba
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

In projects like https://scratch.mit.edu/projects/296724684/ , there are a lot of costumes where a single color theme is used. It is often desired to have different color themes, so that it's possible to render text in a different theme, and also have different colors for each character. The visual effects don't provide enough customization, for example it isn't possible to turn a yellow/black costume into a white/black costume with effects. The pen in the other hand would be way too slow considering how much text there can be.

There are 2 forms of FCR, either of which could potentially become precursors to a new feature in Scratch:

Form 1:

FCR [#FFFF00] to [#FFFFFF] :: grey

The form above takes any pixels of a particular color and changes them to another color, possibly with hardware acceleration. It's possible to have multiple FCR instructions in effect.

Form 2:

FCR R: ()R+()G+()B+(), G: ()R+()G+()B+(), B: ()R+()G+()B+() :: grey

It replaces red, green and blue channels with mathematical expressions based on red, green and blue.

No color change:

FCR R: (1)R+(0)G+(0)B+(0), G: (0)R+(1)G+(0)B+(0), B: (0)R+(0)G+(1)B+(0) :: grey

Inverse colors:

FCR R: (-1)R+(0)G+(0)B+(1), G: (0)R+(-1)G+(0)B+(1), B: (0)R+(0)G+(-1)B+(1) :: grey

Grayscale:

FCR R: (0.299)R+(0.587)G+(0.114)B+(0), G: (0.299)R+(0.587)G+(0.114)B+(0), B: (0.299)R+(0.587)G+(0.114)B+(0) :: grey

Any FCR block of this form would override the previous FCR of this form, working similarly to the effects.

Last edited by ihgfedcba (April 18, 2019 15:19:54)

ihgfedcba
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

Bump.

Supporters (3):

ihgfedcba
-Multinia-
girlsruless (as an extension)

Semi-supporters (1):

openPoll (as an extension)

No-supporters (0):


Rejecters (0):


No rating (3):

Jonathan50
NitroCipher
Flipped_

Scoring rules (add to both numerator and denominator for each instance):

Supporters: 1/1
Semi-supporters: 0.5/1
No-supporters: 0/1
Rejecters: -Infinity/1
No rating: 0/0

Total result for this suggestion: 3.5/4 (87.5% support)

Last edited by ihgfedcba (April 18, 2019 15:19:20)

ihgfedcba
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

Support. This can be very useful with a lot of costumes and when color effects don't provide enough customization, such as in https://scratch.mit.edu/projects/296724684/ .
Jonathan50
Scratcher
1000+ posts

Fast Color Replacement (average global support: 87.5%)

This would probably belong in an extension. Also, “FCR” is an undescriptive name. Perhaps it could be called something like “replace colors” or “quickly replace colors”?

Not yet a Knight of the Mu Calculus.
ihgfedcba
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

Jonathan50 wrote:

This would probably belong in an extension. Also, “FCR” is an undescriptive name. Perhaps it could be called something like “replace colors” or “quickly replace colors”?

"There are 2 forms of FCR, either of which could potentially become precursors to a new feature in Scratch:"
-Multinia-
Scratcher
38 posts

Fast Color Replacement (average global support: 87.5%)

It looks complicated for newer Scratchers, so it should probably be in an extenstion. But, for people who know what they're doing, this could be extremely useful. Support.

insert epic signature here
NitroCipher
Scratcher
500+ posts

Fast Color Replacement (average global support: 87.5%)

Here is some less confusing block syntax:

Replace [#0fBD8C] in sprite with [#5CB1D6] ::#4b4a60

Anyways, I like it! It would fit well with how you can use the color pickers on sprites for the pen tool

Last edited by NitroCipher (April 2, 2019 14:17:41)


I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
ihgfedcba
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

NitroCipher wrote:

Here is some less confusing block syntax:

Replace [#0fBD8C] in sprite with [#5CB1D6] ::#4b4a60

Anyways, I like it! It would fit well with how you can use the color pickers on sprites for the pen tool
Note that it is two separate FCR suggestions in one topic. One is a color replacement, and the other is a RGB transformation.
girlsruless
Scratcher
1000+ posts

Fast Color Replacement (average global support: 87.5%)

support for this being an extension.

ROBLOX, Minecraft, Pokémon, AJ, Miraculous, Warrior cats, HTTYD, and CW fan(and obviosly a girl), girlsruless.





openPoll
Scratcher
1000+ posts

Fast Color Replacement (average global support: 87.5%)

Semi-support for it being an extension, because the blocks are much-needed and are wanted by many Scratchers, but the block's jobs aren't clear and many New Scratchers (and some Scratchers!) Would find the.function of the block very confusing
If that was changed then full support

Last edited by openPoll (April 10, 2019 09:51:20)


Moi? Whaddya wahnt from moi?

——

Inactive Scratcher • making memes wen??? • define defineI have Robux >:)1,000+ hours on Splatoon 2 • 250+ hours on Pokémon White • 100+ hours on MinecraftAn 8 bit remix I love • i have lots game • too lazy to make rainbows • still a proud Windows 7 user
-CodePro-
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

This would be very good for things like a stamp text engine.
I support the first form, the second one looks very long and confusing.
For the first form, you should be able to choose to set, change and multiply the color selected.
Also, it would be nice if it allowed you to choose a color from a costume.

This is my signature, it appears below my every post. Want to change yours? Use the code below in your browsers console.
this.document.location = "https://scratch.mit.edu/discuss/settings/" + Scratch.INIT_DATA.LOGGED_IN_USER.model.username

The more you do now, the less you need to do later. - Me, and a bunch of other people saying it in slightly different ways.
Arceu
Scratcher
500+ posts

Fast Color Replacement (average global support: 87.5%)

Support if it was an extension. It might be useful for REALLY advanced coders.
DoNotFoIIowMe
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

This could be really useful for colour-related (perhaps pen) projects, but I have two conditions:

1. I agree with openPoll that this needs to be an extension and not normal blocks because it would be complicated for New Scratchers.
2. We could try reducing the length of the blocks, they are extremely long and one won't even fit in the normal Scratch Editor.

I also created a 3.0 version for this (password is 3.0): https://thinfi.com/gcc3

Last edited by DoNotFoIIowMe (Nov. 19, 2019 15:40:56)


~DoNotFoIIowMe~

Just Nambaseking01 on a social experiment account!
My name is DoNotFoIIowMe (do not follow me or comment on my profile, you!) and I am a New Scratcher willing to help out on the Scratch community. If you see any of my posts, don't think I'm new myself and that I'm not supposed to be teaching you because I have quite a wide knowledge about Scratch. Just so you know though, following me will ruin my life. People have already disobeyed.
45afc4td
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

DoNotFoIIowMe wrote:

This could be really useful for colour-related (perhaps pen) projects, but I have two conditions:

1. I agree with openPoll that this needs to be an extension and not normal blocks because it would be complicated for New Scratchers.
2. We could try reducing the length of the blocks, they are extremely long and one won't even fit in the normal Scratch Editor.

I also created a 3.0 version for this (password is 3.0): https://thinfi.com/gcc3
This suggestion wasn't supposed to be used for pen (it wouldn't have an effect on it), it would only transform the visible pixels of the sprite in pretty much the same way as an effect.

-CodePro- wrote:

This would be very good for things like a stamp text engine.
I support the first form, the second one looks very long and confusing.
For the first form, you should be able to choose to set, change and multiply the color selected.
Also, it would be nice if it allowed you to choose a color from a costume.

The second form is a “linear transformation” on all the pixels rather than replacing individual colors like the first form. What do you mean by “set, change and multiply the color selected”? Isn't it possible for the color inputs to input a variable from 0 to 16777215 into, to select the color?

Last edited by 45afc4td (Nov. 19, 2019 16:53:05)

-CodePro-
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

45afc4td wrote:

-CodePro- wrote:

This would be very good for things like a stamp text engine.
I support the first form, the second one looks very long and confusing.
For the first form, you should be able to choose to set, change and multiply the color selected.
Also, it would be nice if it allowed you to choose a color from a costume.

The second form is a “linear transformation” on all the pixels rather than replacing individual colors like the first form. What do you mean by “set, change and multiply the color selected”? Isn't it possible for the color inputs to input a variable from 0 to 16777215 into, to select the color?

set = set the RGB/HSL values to something else.
change = change them relative to the original color.
multiply = multiply or divide them relative to the original color.

Although the most simple and important is replace (color) with (color). (set)

This is my signature, it appears below my every post. Want to change yours? Use the code below in your browsers console.
this.document.location = "https://scratch.mit.edu/discuss/settings/" + Scratch.INIT_DATA.LOGGED_IN_USER.model.username

The more you do now, the less you need to do later. - Me, and a bunch of other people saying it in slightly different ways.
45afc4td
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

The form 2:

FCR2 R: ()R+()G+()B+(), G: ()R+()G+()B+(), B: ()R+()G+()B+() :: grey

would be the most feasible one. Entering different values would overwrite the FCR2 with a different one. ‘clear all effects’ would clear the FCR2 as well.

Clearing the FCR2 is equivalent to:

FCR2 R: (1)R+(0)G+(0)B+(0), G: (0)R+(1)G+(0)B+(0), B: (0)R+(0)G+(1)B+(0) :: grey

The form 1:

FCR1 [#FFFF00] to [#FFFFFF] :: grey

doesn't look as good. Multiple FCR1 instructions can be in effect, but what if the user iteratively replaces each of the 16777216 colors to the next color? Every pixel would become white, and many FCR1 instructions would have to be processed, causing a major slowdown, and the only way to remove those FCR1 instructions by the suggestion is to ‘clear all effects’.
ResExsention
New to Scratch
1000+ posts

Fast Color Replacement (average global support: 87.5%)

Support. Could be useful for like inverted color “glitchy spacetime” events.

Though I must suggest renaming “FCR” to something like:

replace every color [] with [] :: sensing

Infrequently active.

It feels weird to see how far we've come. I hope you're well, wherever you are!
-CodePro-
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

45afc4td wrote:

Clearing the FCR2 is equivalent to:

FCR2 R: (1)R+(0)G+(0)B+(0), G: (0)R+(1)G+(0)B+(0), B: (0)R+(0)G+(1)B+(0) :: grey
R, R+ and G+ are 1
Do I not get it or shouldn't it be:
FCR2 R: (1)R+(0)G+(0)B+(0), G: (1)R+(0)G+(0)B+(0), B: (1)R+(0)G+(0)B+(0) :: grey
?

This is my signature, it appears below my every post. Want to change yours? Use the code below in your browsers console.
this.document.location = "https://scratch.mit.edu/discuss/settings/" + Scratch.INIT_DATA.LOGGED_IN_USER.model.username

The more you do now, the less you need to do later. - Me, and a bunch of other people saying it in slightly different ways.
45afc4td
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

-CodePro- wrote:

45afc4td wrote:

Clearing the FCR2 is equivalent to:

FCR2 R: (1)R+(0)G+(0)B+(0), G: (0)R+(1)G+(0)B+(0), B: (0)R+(0)G+(1)B+(0) :: grey
R, R+ and G+ are 1
Do I not get it or shouldn't it be:
FCR2 R: (1)R+(0)G+(0)B+(0), G: (1)R+(0)G+(0)B+(0), B: (1)R+(0)G+(0)B+(0) :: grey
?

It's R set to 1R + 0G + 0B + 0, G set to 0R + 1G + 0B + 0 and B set to 0R + 0G + 1B + 0. Every channel is set to itself. Your set of parameters would set all three channels to red, meaning the color becomes a shade of gray set to the red channel, so it doesn't set every color to itself. The inverse formula (in the beginning of the topic) adds a constant 1 and adds -1 multiplied by the channel — this creates an inversion effect, because every channel is set to the inverse of itself. The grayscale formula sets every channel to the sum of 0.299 times red, 0.587 times green and 0.114 times blue, which approximates the visual brightness.
45afc4td
Scratcher
100+ posts

Fast Color Replacement (average global support: 87.5%)

Bump, even though this is a high level function, there is not much possible sprite replacements in form of “effects” so this does make sense; it is really not workaroundable.

Powered by DjangoBB