Scanning color and listing locations (?)

I’m getting into creating lightshows. This would be very helpful to me :slight_smile:
I would like to scan for ONE color in a photo and
have its pixel LOCATIONS listed in a PARTICULAR way. Three words given emphasis; these are the main aspects—it seems easy on the surface, but it gets really tricky for me to explain. Please excuse how it’s a little fragmented at times. I have done my best and really-really will appreciate the how-to for this. I would be willing to pay a fee for someone to guide me through this, but I thought it might be easier than I think, and so here I am. Thank you!!!

Now, how I’d want this to be and how I think it might be processed…:

  1. Import photo.
    [I just downloaded Python; I don’t even know how to do that yet!]
    Will this photo need to be in a specific folder? grr, sorry, I’m a baby lol.

  2. Add color wanted to be scanned. HTML Notation, eg. ecff16.

  3. Given the Y-axis rows and X-axis columns of pixels, a number can be
    associated with each row and column; the output of one location of a pixel, for example, may then be output as “Y32/X10”.
    It may not be necessary to include the Y and X, but I would like to have it an option.
    The output being “Y32/X10” or simply “32/10”.

  4. Now for the scanning pattern and output format (tricky to explain).

I would like to set a scanning pattern.
This pattern will always be the same, so maybe established once and called upon
when needed?
The pattern is Zig-Zag…:
A. Always start the scan with Y1/X1 pixel.
B. Scan DOWN Column X1 to its last pixel.
The output will read the matches in the order found, such as:
“Y3/X1,Y6/X1,Y23/X1,Y45/X1,end”
(Note numbers in succession, 3, 6, 23, 45, yep)
—Important to have each Column read as one line.
—Important to have commas between.
—Important to be able to assign a word or phrase to appear at the end of each line.
C. The scan will proceed from the BOTTOM of X2 and scan UP
to the very TOP pixel of X2 Column. A new line created for X2. So far,
we have this:
Y3/X1,Y6/X1,Y23/X1,Y45/X1,end
Y44/X2,Y35/X2,Y22/X2,Y12/X2,Y3/X2,end
D. The scan then proceeds with the TOP pixel of X3, scanning DOWN,
proceeding as from the very start; hence the Zig-Zag pattern.
Y3/X1,Y6/X1,Y23/X1,Y45/X1,end
Y44/X2,Y35/X2,Y22/X2,Y12/X2,Y3/X2,end
Y5/X3,Y8/X3,Y34/X3,Y44/X3,end
…so on, to the very last pixel, which may be at the TOP or BOTTOM,
depending on if the number of Columns is even or odd.

And that’s it :slight_smile:

I thought a “Batch” process might be possible, which might be
very useful; requiring a few extra Commands.
A. Enter a LIST of colors, such as:
“ecff16, 51496a, 496a4b” so on, would not be so many at a time.
B. Somehow have the output read which color each output list refers to;
maybe at the top, then a line space, such as:
"ecff16
Y3/X1,Y6/X1,Y23/X1,Y45/X1,end
Y44/X2,Y35/X2,Y22/X2,Y12/X2,Y3/X2,end

51496a
Y6/X1,Y24/X1,Y52/X1,Y65/X1,end
Y56/X2,Y43/X2,Y20/X2,Y13/X2,Y4/X2,end

so on

The program will start from the first color, scan, proceed to the next, scan, then to the next, in order, successively, automatically, like magic :slight_smile:
C. The resulting lists can be exported into a txt file? hmmm
Now that’s just being greedy! haha

And THAT would be totally IT! :slight_smile:

At this point, I notice many peripheral packages that I may need to import. I’m just getting familiar, but ready for work! :slight_smile: I will read every single word here offered; I will do my best to piece it all together to the whole. Thank you so so much for any guidance.

Welcome.

It’s good to have a goal starting out, but the best thing you can do right now is to set it aside and start practicing with the fundamentals of Python. (I would say the same for any programming language.) There are skills you need to make sure of before it’s possible to write code at all. Of course, I know you have a lot of them already, because you were able to turn on a computer (or phone, nowadays, I guess?), connect to the Internet, find this forum and post :wink:

But then there are the next steps:

  • Make sure you know Python is installed, not just downloaded, and where it is.
  • Make sure you understand how to start the Python interpreter and start trying out some code. This can depend on your operating system, on choices you made when installing Python, and on whether you are familiar with the command line for your operating system. (You can also choose to study that first and use it for starting Python; in the long run there are many benefits. But Python also bundles a simple editor that makes it easy to get to the interpreter and also save code in files. It’s minimal, but it works.)
  • Try to follow a general, introductory tutorial at least for a bit, especially if you haven’t used other programming languages before either. (I assume you haven’t; people who have are usually more confident.) The documentation on the web site has a tutorial built in.

If any of that seems too simple, great! People can and do get stuck anywhere, so I try not to take anything for granted. But do make sure you know the things that you think you know.

By the time you are comfortable writing Python code, you may find that you have totally different ideas about your design, or at least you will be able to explain it to yourself a lot more clearly. For example, you might decide that a different format (way of specifying) pixel coordinates makes more sense. Or you might realize that for the photos you want to process and output you want to get, maybe an exact color value doesn’t work very well. Or maybe you’ll have a clearer idea of what “scanning” is actually supposed to entail, and what you want to do with the pixels you find during the scan. (Do you want the program to just directly tell you where the matching pixels are? Or do you want another part of the program to do something involving those pixels? Or maybe I completely misunderstood, and you want to input pixel positions that the program should know about… to do something… ?)

Your program can read (“import” means something different for us) a file from anywhere you could access normally. But to do this you need to understand the system that your computer uses to organize files. (You can download them from the Internet directly into memory, too; but similarly you will need to know the right URL, and use a web library.) Each file has a path as well as a name; and you can describe a location with either an absolute or relative path; and for relative paths you will need to understand what they are relative to.

In order to make sense of the data in the image file, you are going to need some kind of library. I say “need”; of course it’s possible to do “from scratch” (after all, it was possible to make the library!), but it’s work that’s not interesting for your goal and too complicated to be worthwhile. However, before trying to use such libraries I strongly recommend that you get familiar with opening and working with simpler kinds of files (starting with plain text).

It will not be useful to try to pay for something like this (and as far as I’m aware, this is not an appropriate place to offer or ask for money). You can pay tutors to teach you programming or improve your skills generally (or, sigh, to help study for a course); or you can pay developers to make a program for you. But I don’t think anything in between will work well.

1 Like

Hi Karl :slight_smile:
The depth of your orientation is heartfelt! Thank you for your insights on The Approach, (to speak). You would make an outstanding advisor for undecided Freshmans (and all Python Babies alike haha), no doubt.
In the now, it is most efficient for me to be scanning the field of available programs, posing the same idea, and simply seeing which is actually capable of such, without question. With that established, I would then, most definitely, be focusing full-steam on the functionalities of Python and having the idea come to life. Then, in the process, as you note, finding ways to alter things for the [unseen] better. The idea, as stands, though…; I see it as being all needed and would take the route of paying a programmer to lay it all out for me. I am not asking this here, mind; I am seeing if it possible with Python, foremost, and seeing what paths, then, will lead to the idea materialized. :sparkling_heart: I will now read your notes again, and perhaps again and again while waiting out this path… Much to be said to you, little time…, thank you Karl :slight_smile: