2022-09-02 20:47:51 Ugh. 2022-09-02 20:48:14 So, a couple of years ago my kids got me a digital photo frame for Christmas; one of the ones you can email pictures to. 2022-09-02 20:48:16 Love it. 2022-09-02 20:48:28 I decided to get one for my mom; her birthday is Wednesday. 2022-09-02 20:48:41 So, got and started thinking about how to pre-load it. 2022-09-02 20:48:54 The services web portal doesn't offer a bulk download feature. 2022-09-02 20:49:08 No problem - i installed a plugin into Chrome and downloaded all the images that way. 2022-09-02 20:49:16 The service portal does offer a bulk upload. 2022-09-02 20:49:44 So, I did that, and it spun and spun and spun and wound up transferring 410 of 704 photos before crashing. 2022-09-02 20:49:52 Well, damn it. 2022-09-02 20:50:25 So, I figured it shouldn't be too bad - I downloaded all of the ones that made it to her frame into another directory, and thought I'd use dupes to figure out which ones were still left to go. 2022-09-02 20:50:27 But... 2022-09-02 20:50:36 They don't have the same names. 2022-09-02 20:50:38 And... 2022-09-02 20:50:44 THEY DON'T HAVE THE SAME SIZES. 2022-09-02 20:51:02 Some sort of tinkering was done somewhere in the chain. 2022-09-02 20:51:34 I'm sitting here thinking that if I really want to set a challenge for myself, I'll set out to write a program that compares them by image comparison. 2022-09-02 20:51:44 The way we'd do it manually. 2022-09-02 20:51:48 Except automated. 2022-09-02 20:52:35 Shouldn't be that hard to write something that would check dimensions first, then grid by pixels and compute some sort of grid cell averages to produce a signature. 2022-09-02 20:52:56 Then match those signature shapes. 2022-09-02 20:53:16 Wouldn't require an exact match - just look for the same pattern of variation across the image. 2022-09-02 20:53:54 I could probably do it manually in less time, but it seems like an interesting problem. 2022-09-02 21:27:04 My first thought about that would be to grid each picture into an NxN array of cells, calculate some value for each cell, regard those N^2 values as a vector in N^2 dimensional space, and normalize it to unit length. 2022-09-02 21:27:41 Then match by finding the angles a pic in group 1 makes with each pic in group 2; minimum angle gets selected as the match. 2022-09-02 21:29:27 This would be after unwinding any compression - I'd have to get 'em to RGB form first. 2022-09-02 21:30:23 might be better to keep the color channels separate, so it would be 3*N^2 dimensional space. 2022-09-02 21:45:13 Wow - Python PIL is sweet. 2022-09-02 21:47:34 a bitter pill to swallow 2022-09-02 21:51:43 :-) 2022-09-02 21:52:04 Easy to load the image; easy to read out pixel data. 2022-09-02 21:52:20 This won't be as hard as I thought it might be. 2022-09-02 21:54:10 from PIL import image 2022-09-02 21:54:19 img=Image.open(path) 2022-09-02 21:54:36 r,g,b = img.getpixel((x,y)) 2022-09-02 21:54:39 That's it. 2022-09-02 21:55:13 This is why I like Python - it just makes stuff like this so simple. 2022-09-02 21:56:26 I'll need a bit of bookkeeping; check sizes and so on. But that all looks equally simple.