tucson.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Jaromil@fed.dyne.org to retrocomputing@lemmy.sdf.org · 2 years ago

Has anyone C code to filter frames to 1bit color depth approximation?

fed.dyne.org

message-square
11
link
fedilink
30

Has anyone C code to filter frames to 1bit color depth approximation?

fed.dyne.org

Jaromil@fed.dyne.org to retrocomputing@lemmy.sdf.org · 2 years ago
message-square
11
link
fedilink
alert-triangle
You must log in or # to comment.
  • vrighter@discuss.tchncs.de
    link
    fedilink
    arrow-up
    15
    ·
    2 years ago

    you want to convert the image to grayscale properly (using luminance, not the mean of the rgb colors), then you can palettize it using a dithering algorithm like floyd-steinberg, with a palette containing only the colors black and white.

    • Jaromil@fed.dyne.orgOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      2 years ago

      I’m looking for a source code in C that does that, to include it in frei0r, before I have to go and write it myself…

      • vrighter@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        I told you what to look for. It’s a simple algorithm. Maybe try looking at the “implementation” section on the wikipedia page…

  • Synthead@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 years ago

    Check out ImageMagick.

  • cyberic@discuss.tchncs.de
    link
    fedilink
    arrow-up
    5
    ·
    2 years ago

    I would check out some tools written for the PlayDate game console (which is 1-bit)

    https://devforum.play.date/t/playdither-a-web-tool-for-1-bit-image-dithering/5339

    • Jaromil@fed.dyne.orgOP
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      this is awesome!!! thanks!!! <3

      • Kit Sorens@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        Looks like the arduboy’s display. Might look for some C++ arduino libraries. Additionally, it never hurts to have gimp/PS skills for stuff like this, and there are likely plugins for both.

  • GrappleHat@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 years ago

    I don’t understand the question. Are you looking for a tool which converts images to 1-bit? With dithering to simulate greys?

    This art is super cool, btw! Where can I find more?

    • Jaromil@fed.dyne.orgOP
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      yes I’m looking for C algorithms for that. I just searched for “1bit old-school image”

      • mrkite@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        2 years ago

        Search for Floyd Steinberg dithering. That’s the algorithm used by a lot of classic Mac software.

      • GrappleHat@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 years ago

        This web utility seems like exactly what you’re describing. I think this was a small app someone made for themselves while developing a game for Playdate. The source might be available on their Github. If not they seem friendly, you could ask for it.

retrocomputing@lemmy.sdf.org

retrocomputing@lemmy.sdf.org

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Discussions on vintage and retrocomputing

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 52 users / day
  • 168 users / week
  • 714 users / month
  • 2.29K users / 6 months
  • 2 local subscribers
  • 5.23K subscribers
  • 615 Posts
  • 2.64K Comments
  • Modlog
  • mods:
  • SDF@lemmy.sdf.org
  • Nathan Byrd@lemmy.sdf.org
  • Penkster@lemmy.sdf.org
  • BE: 0.19.12
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org