tl;dr: I’m looking for advice on is loading the pixel values into Applescript and writing pixel values out to file.
More info:
I’m just looking for advice here before getting started on doing something… a project I’m sure Applescript is the wrong language for. But when all you’ve got is a hammer…
I just need something working so I can 1. Experiment and tweak the math, and 2. use as a proof-of-concept. If it works, then we can hire a programmer to do the thing in C++ as a Photoshop Plugin or something.
I need to do math on pixel values. It’s too much math and too different from anything Photoshop does natively for me to just script it with Photoshop doing it.
So what I’m looking for advice on is loading the pixel values into Applescript and writing pixel values out to file.
This will eventually need to run on files around 12" x 14" at 300 dpi. So I’m pretty sure that if I move the “Color Sampler Tool” around the 15 million pixels of my document to get the values, then build selection and fill them with colors one by one to produce the output colors after my calculations, that I’m going to be looking at run times that aren’t even OK for a proof on concept… like, weeks. I probably need to spend a while tweaking my math, I need to at least have the thing finish a file in a few hours to make a usable feedback loop for development. If course, I’ll test on smaller files, but I still need about 1.5 megapixels just to see what’s going on.
So the questions is, what’s the best way for me to get a bunch (all) of the pixel values from a file into Applescript, and then back out to a file?
I’ve been looking at this thread http://macscripter.net/viewtopic.php?id=16233
specifically, Dominic’s post using tiffutil and hexdump to get at the values. All my calculations will be done in LAB color, so if it’s possible to save in a format that support LAB color and write back out in it, I expect that will speed things up versus converting to and back from RGB in Applescript.
Any advice? Has anything changed in the 10 years since that thread I found? I thought I’d ask before I start making stupid mistakes.
Thanks in advance,
Tom.