Re-reading old code and I’m reminded of this old trick for doing bit-manipulation:

I was trying to shift right an u8 by a value between 1 and 8 bits:

myu8 >> (8 - shift)

If shift equals 0, this would be an 8 bits shift, I wanted the result to be zero (all bits shifted), but that's not how (some) CPUs work; so it's undefined behaviour, and in Rust, the compiler will throw a compile error (if it's a const shift), or panic at runtime in debug mode.

One could test if shift is 8, and adjust code accordingly, but this adds branches and even more code.

So the trick to work around that is simply... to shift twice ! One time for the first bit, and another for the last (potential 7):

(myu8 >> 1) >> (8 - shift - 1)

And that's how one can do this operation fully branchless.

(another version of this post appeared on a now-defunct instance)

#RustLang #bitmap #BitManip

With #VariableFont , #Bitmap is fun again

#Gravit Designer vs. #Corel Vector (2#4)

Da ich bis heute keine Lösung gefunden habe, was das gvdesign Fileformat native und verlustfrei unterstützt, überlege ich mit Hilfe der alten OpenSource-Codes einen gvdesign Parser zu schreiben, und ggf. ein bessere Zielformat als SVG/PDF/PNG zu finden.

Hat wer Lust hier mit zu machen?

-> (3#4)

\__
#OpenSource #Bitmap #Vector #pwa #gvdesign #json #docker

#Gravit Designer vs. #Corel Vector (1#4)

Heute ist der Todestag von "Corel Vector", früher bekannt als "Gravit Designer". Imho eins der besten webbasierten Grafik-Design Apps, die wunderbar Vektor, Typo & Bitmap miteinander verbunden hat. Würde sagen, es war seiner Zeit um 10-12 Jahre voraus.

Gravit Designer war sogar mal OpenSource. Deswegen habe ich darauf gesetz. Und nun hat Corel es wohl nur gekauft um es als Konkurent zu beseitigen.

-> (2#4)

\__
#OpenSource #Bitmap #Vector #pwa

PixiEditor https://links.shikiryu.com/shaare/cquPyA Gimp et Inkscape en 1 seul outil. À surveiller !
#image #alternatives #vectoriel #bitmap
PixiEditor

Gimp et Inkscape en 1 seul outil. À surveiller !

-=:[ WarGames Terminal Fonts ]:=-

WarGames Terminal Fonts

Just remembered this gem.

"Have you got an image enhancer that can bitmap?"

https://www.youtube.com/watch?v=LhF_56SxrGk

#enhance #cinema #vector #bitmap #bladerunner

Let's Enhance HD

YouTube
Just shared a glimpse of my desktop setup over on https://deskto.ps!
Currently rocking a cool bitmap wallpaper from the bitmap-walls(https://github.com/dkeg/bitmap-walls) collection
something about those simple patterns just clicks for me.

Plus, everything feels so snappy with my trusty TWM. What does your desktop look like?
Share your screenshots! ☻☻☻
#Desktop #Linux #TWM #WindowManager #Bitmap #Wallpaper #Minimalism #ShowYourDesktop

Mine -> https://deskto.ps/u/r1w1s1/d/pfpn2j