The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
Invent Your Own Color Reduction Algorithm
Learn image processing in a fun way by writing your own color reduction programs.
Color reduction converts a photo or a painting into a compressed format with only a handful of colors. This book begins with a beginner's guide to the field and continues with in-depth material for advanced readers.
Minimum price
$17.50
$21.00
About the Book
Apply the fundamentals of computing, color science, image compression and machine learning to write your own color reduction programs.
Subjects discussed in the book include the median cut and k-means clustering algorithms, error diffusion dithering and ordered dithering. This volume collects effective improvements to each of the algorithms. To the best of the author's knowledge, this book is the first attempt at such a synthesis across industry practice and academia.
The book is suitable for
To get most out of the book, a reader should have at least a year of programming experience and high-school-level knowledge of mathematics.
Since color reduction is a niche subject, the first part provides a hands-on guide to writing a full color reduction program. The second and third chapters then deepen the discussion with a more technical focus and also act as a reference.
This book is not yet complete, but I think it's already an interesting read. It has 9 of the 16 of the planned chapters available, plus appendices. Some diagrams are still sketches.
Chapters available so far cover the full first part and about half of the second:
Part 1: The Baseline Method
Part 2: Dithering, Color and Vision
The rest of part 2 and the full part 3 will be added later.
The planned release of the full version, including a printed edition, is in March 2027. Buyers of the early access release will receive the full digital version for free, of course.
Updates planned next:
The upcoming chapters discuss color spaces, human visual system models and advanced color quantization methods from the academic literature.
The text hasn't been fully edited for language yet, so this early access version may still occasionally read a bit strangely. I hope to hire a professional copyeditor to help me out before the 1.0 release.
I believe that the book is already valuable to some, even though the reading experience may be rough. The contents are based on my research on both open source code and academic literature, without forgetting small experiments I did myself. The combined research and writing has taken me over a year and a half already, and I think the early access version's chapters already include a ton of interesting stuff.
Also, by releasing early, I hope to solicit reader feedback. Since I'm self-publishing, there may be obvious flaws that I have missed but can still fix before the final release. It's actually incredibly hard to get someone to read an unfinished manuscript, I've learned.
I've priced this early access version to reflect the value I believe it brings, even though it's still incomplete. The price slider allows a 15% self-service discount for students or readers from low-income regions. The price will be gradually raised throughout the early access period.
This work does not contain any AI generated text or imagery. Not even "extensively edited" generated stuff like some admit to have, whatever it may mean. I'm no saint though as I still run local models for checking grammar, catching unidiomatic phrases, and also for authoring various scripts and tools. This includes assistance on the book website's technical implementation.
About the Author
Pekka R. H. Väänänen (M.Sc. computer science) is a software engineer who writes about computer graphics on his website at 30fps.net.
He has worked on 3D model streaming and robot simulations at Umbra, and with 3D reconstruction and VR headset tracking at Varjo.
He also hacked on 2D graphics drivers as an intern at NVIDIA, a long time ago.
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.