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gPJgeRAciA5kBxojRm7PPEizViJ159+ffkOB7dO2PfsPmhfjIJLeN+W/5/+WeXo3+uQz9So2IdHV/9xrHyY0c9mHDz9c87afQDrOTk68agrOeSQQw455JAjMk0OjOTAqBMcvBXSOWv3Aazlc9ikelqGDR8rdu70HbtmycNbPE2Sv7Lm9dNF4i2kvr6GZygqSr6gYYkN27+6vhs15ChOt4cnTQ4kB5IDyYHkQHIgOZAcSA6UzLHoO8cEz1nZzsaHXhqeF+h8EY5nvPTjXHt40uRAciA5kBxIDiQHkgPJgeRAciA5EDn24Uv87dPv59rDk0aO3Tzocf4QdK1rWBa79XPkC+xrLXJj8EH9K5ovPjmQHEgOJAeSA8mB5EByIDmQHCi2Zuk9x+oprN0rWC+iyPmOPtbwNmrXmhxIDiQHkgPJgeRAciA5kBxIDvRrMDokx+swrIdrWDP722+4TLrS0rwNTgAAAABJRU5ErkJggg==

in to each Pixel RGB Values. This means I need a converter, but I have no idea how to convert stuff. I need an explanation on how I get the RGB of the Base64 String. or you could give me a Project on the website scratch.mit.edu which already made this happen.

My goal at the end is to recreate the entire Base64 code in to a image again but I want to make my own engine/converter for it.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • Welcome to Stack Overflow. Please read about [asking questions](https://stackoverflow.com/help/asking). – Jason Aller Dec 02 '21 at 15:55
  • "I want to make my own engine/converter for it." Why? As an academic exercise? Because you do not like existing conversion tools? Because you are under the impression that this will be easier in Scratch than in a more library-rich programming language you may not (yet) be familiar with? There's plenty of standard tooling _outside_ of Scratch to help you turn that string into a regular PNG file (which you can then upload as a costume into your Scratch project) or into a list of RGB values (which you can then import into a list in Scratch, making individual pixels accessible to your code). – Ruud Helderman Dec 02 '21 at 16:53
  • It says "Hi" inside a speech-bubble. You can easily find that with an ImageMagick one-liner, but you seem to want to do it the hard way. – Mark Setchell Dec 02 '21 at 18:05

1 Answers1

0

So when you want to scan for a color what you need is to find the color CODE for the color value, this is usually represented as the equation showed : (R65536) + (G256) + (B) You can also find that by putting this in the pen setting, and then changing the values, the color is changing, but scratch understands the outcome of the equation as a number, not a RGB value This also means that there is no way to convert the Base 24 file into RGB values, but instead, to load the image into a costume, create a new sprite, and then make that the pixel size (2x2 is reasonable for hitboxing) name that scanner, and then you need to find a way to scan through the entire list of recognizable colors using the "touching color block", this will mean that you will check what color the pixel is, you can save this to a list and then you can find a simple way to recreate the image. Then you also need to find a way to move on to the next pixel. This is how you can take photos with scratch, yet you will need to stand still for a few hours because the program is trying to scan around 6000 different combinations in a single frame(1sec / 30).