-- Leo's gemini proxy

-- Connecting to taoetc.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Re: Dithering: an idea whose time has finally come?


mntn.xyz talks about dithering:


mntn.xyz talks about dithering


> It seems that dithering is undergoing a renaissance on Gemini. Not only does it introduce a pleasant retro aesthetic, but for images with smaller dimensions, dithering with a reduced palette can both save bandwidth and make content more accessible to old devices.


I decided to give it a try, with a couple twists.


Sunrise in the Estero Americano, Bodega Bay, CA


Python dithering


I'm using Python to dither the images:


from PIL import Image

input_ = Image.open('image.jpg')
output = input_.quantize(
    colors=8,
    dither=Image.FLOYDSTEINBERG,
    kmeans=1,
)

CSS blending


On my blog I'm blending the dithered images using CSS, depending on the choice of a light or dark theme:


@media (prefers-color-scheme: dark) {
  img {
    mix-blend-mode: screen;
  }
}

@media (prefers-color-scheme: light) {
  img {
    mix-blend-mode: multiply;
  }
}

Enclosures


Image sunrise.png


Tags


blog

technology


Categories


STEM


About


Published on 2021-10-11 02:04:22+00:00 by Beto Dealmeida <roberto@dealmeida.net>.


Go back to the main index

-- Response ended

-- Page fetched on Mon May 6 07:45:25 2024