Designer / Engineer / robmason.co.uk
Somehow I missed that, oops. I see that the library samples a maximum of 250K pixels from the input buffer (I jumped over to the project readme)
That being said, this is sampling the fixed-size input buffer for the purposes of determining the right colour. You still have to load the bitmap into memory, with all the associated footguns that arise there. The library just isn't making it worse :) I suppose you could memmap it.
Makes me wonder if the sub-sampling is actually a bit of a red herring, as ideally you'd want to be operating on a small input buffer anyway. Or some sort of interface on top of the raw pixel data, so you can load what's needed on-demand.
As a designer, I've built variants of this several times throughout my career.
The author's approach is really good, and he hits on pretty much all the problems that arise from more naive approaches. In particular, using a perceptual colorspace, and how the most representative colour may not be the one that appears the most.
However, image processing makes my neck tingle because there are a lot of footguns. PNG bombs, anyone? I feel like any library needs to either be defensively programmed or explicit in its documentation.
The README says "Finding main colors of a reasonably sized image takes about 100ms" -- that's way too slow. I bet the operation takes a few hundred MB of RAM too.
For anyone that uses this, scale down your images substantially first, or only sample every N pixels. Avoid loading the whole thing into memory if possible, unless this handled serially by a job queue of some sort.
You can operate this kind of algorithm much faster and with less RAM usage on a small thumbnail than you would on a large input image. This makes performance concerns less of an issue. And prevents a whole class of OOM DoS vulnerabilities!
As a defensive step, I'd add something like this https://github.com/iamcalledrob/saferimg/blob/master/asset/p... to your test suite and see what happens.
Same.
I think I've unintentionally trained myself to notice (and tune out) both AI illustrations and AI writing.
At a deep instinctual level, knowing that someone hasn't spent much time or effort creating the content makes me not want to reciprocate with time or effort.
I've realised that my brain literally tunes out AI illustrations, much as it does with ad banners.
Perhaps since they're easy to generate, I encounter illustration more -- it's no longer a signal of quality.
This is an issue on Linux too, especially when Wayland is used and applications are responsible for drawing their own chrome. Ugh.
HOWEVER, due to the open nature of the platform, you can install an extension to clean this up. Now, all my windows have identical corner radii, strokes, shadows etc. My Linux desktop is, surprisingly, more consistent now than macOS in this regard.
https://extensions.gnome.org/extension/7048/rounded-window-c...
I was unable to reach a business this week who host their email on Office 365. Any email I sent would bounce with:
550 5.7.520 Message blocked because it contains content identified as spam. AS(4810)'
For context, I was replying to an existing and very mundane email thread.Something is rotten in the state of Outlook
This project is an enhanced reader for Ycombinator Hacker News: https://news.ycombinator.com/.
The interface also allow to comment, post and interact with the original HN platform. Credentials are stored locally and are never sent to any server, you can check the source code here: https://github.com/GabrielePicco/hacker-news-rich.
For suggestions and features requests you can write me here: gabrielepicco.github.io