FIM – Linux framebuffer image viewer

(nongnu.org)

140 points | by Mr_Minderbinder 1 day ago

10 comments

  • haunter 19 hours ago
    It can actually be also used for file recovery/discovery, see the last slide

    https://archive.fosdem.org/2023/schedule/event/om_fim/attach...

    >seek a ’magic’ signature in the file after opening it, and try decoding it starting within the range of that signature

  • kristopolous 18 hours ago
    there's a really interesting terminal image viewer based on cellular automata I made almost 20 years ago ... makes every image a bit animated in weird ways: https://github.com/kristopolous/ascsee
  • lrvick 23 hours ago
    You can also use mplayer with "-fp" to play video on the frambuffer as well.

    I have gone weeks at a time without using a graphical desktop at all thanks to these tools.

    • xattt 21 hours ago
      Do you browse with framebuffer links too? :)
      • lrvick 20 hours ago
        These days I prefer to ask an LLM to just go fetch content for me as much as possible.
        • aussieguy1234 50 minutes ago
          How often do they run into anti bot protections?
      • monsieurbanana 20 hours ago
        -links +lynx
        • yesbabyyes 18 hours ago
          `links` is a text mode browser which is more capable than `lynx` and which has graphics support through the framebuffer.
          • mghackerlady 18 hours ago
            and elinks is better than both of them :))
            • lrvick 13 hours ago
              and w3m if you want support for images
              • d3Xt3r 9 hours ago
                And chawan is better than all of them, even has basic support for CSS and Javascript.
    • 1vuio0pswjnm7 15 hours ago
      I have gone 18 years for me without using a graphical desktop
      • lrvick 13 hours ago
        Are you blind or committed?
    • antisol 22 hours ago
      yep! and ffplay will detect your situation and run on the framebuffer if that seems appropriate. I'm sure there's arguments to explicitly tell it to do that, but I've never used them :)
    • hkt 22 hours ago
      This is a great tip, do you have others? I've tried to ditch graphical desktop envs and failed pretty miserably on media consumption and browsing before.
      • zamadatix 18 hours ago
        I messed with this a bit and found fbdev forces even gpu accelerated video decode or rendered apps (e.g. even terminal text these days) to go through the CPU/RAM copy path whereas a lightweight graphical setup (like a minimal sway with a full screen terminal window open) is zero copy. Minor thing, but I'll gladly trade a little RAM for some battery life + simplicity if I ever do need to open something actually graphical on the machine.
        • akdev1l 17 hours ago
          If you wanted a minimal terminal with graphical support then you should probably just run a minimal Wayland session with cage + terminal emulator

          fbdev is not it, going through the DRM subsystem is much better

      • yonatan8070 19 hours ago
        I'm curious, what's the motivation for not having a graphical environment at all?
        • lrvick 13 hours ago
          Initially about 15 years ago because the laptop I bought did not have kernel support for the mobile gpu so I could not run a graphical desktop for a while, so I added kernel support for framebuffer on my GPU myself which was only a 7 line change (upstreamed to kernel) and then realized the framebuffer plus tmux and I was kind of set apart from youtube, so I wrote a one liner to pull raw video content from youtube and stream to the framebuffer with mplayer.

          Overall I found there was almost nothing to do my job that actually required a GUI so did not bother fixing it.

          The only software I tend to use today is a terminal and a browser, and graphical browsers are a hellscape of cookie approval prompts and ads and tracking. Thankfully today a local LLM can go to the web and fetch whatever content for me, so I am once again phasing out my use of web browsers.

          • negura 11 hours ago
            > The only software I tend to use today is a terminal and a browser

            i'm exactly in the same situation. for this reason i run on dwm and no DE. but i'd like to phase out some of my web browsing, for the same reasons you mentioned. could you please elaborate on your local LLM setup and how you use it to substitute web browsing?

            • lrvick 10 hours ago
              "Can you setup a daily job to monitor and download youtube videos from any channels listed in subscriptions.txt"

              "Can you setup a daily job to search for any articles on supply chain attacks, format them as normalized markdown files and store them under Research/supply-chain ?"

              "Can you go find me a good price on some used DDR5 ram from a reputable seller?"

              Etc etc.

              Use agents to bring the internet to you.

              Can do basically anything with a Strix Halo board at home.

              • negura 8 hours ago
                interesting. i can definitely think of similar use cases. but can all of this be accomplished with local LLMs? do you run it on expensive hardware? are there specific models, agent frameworks and other tooling you recommend?

                btw as another strategy to avoid web browsing i've been relying a lot on content being delivered as email newsletters. seems like it would also be easy to process that using LLMs

        • aaplok 9 hours ago
          For me it's about having a distraction-free environment. I dislike having useless information cluttering my screen real-estate.

          Even now that I moved away from text-only, I typically work only with fullscreen windows. All I want to see is what I am focusing on at the moment.

        • argomo 14 hours ago
          It's not for me, but I can see the appeal - minimalism, distraction elimination, geek cred, and the sort of flow state one gets from working in a low latency, high muscle memory environment.
      • fc417fc802 11 hours ago
        It's not an answer to your question per se but I find various keyboard driven tiling WMs to be sufficiently minimal while still allowing GPU accelerated stuff to "just work".
      • redsocksfan45 22 hours ago
        Don't use mplayer for this. Use mpv --vo=gpu --gpu-context=drm

        This gives you hardware acceleration without a desktop environment.

    • wazoox 18 hours ago
      Ah yes, back in 2004/2005 I got an old laptop (Pentium 200 or something like that) for free that wasn't fast enough to reliably read videos with X11, but it worked fine as a movie watching device for my children using mplayer in FB mode :)
  • anthk 22 hours ago
    I think this came with fbgs too; and fbpdf2 it's a better fbpdf (no more slow GhostScript convertings), it just calls poppler/MuPDF libraries.
  • sylware 1 day ago
    Should it be DRM nowdays?
    • whizzter 23 hours ago
      I think the framebuffer devices is a least common denominator that is available on even miniscule or emulated hardware whilst anything above thats starts requiring a whole lot more infrastructure.

      And honestly, you don't need much more for an image viewer.

      • antisol 23 hours ago
        This is exactly right - you can get a framebuffer on just about anything, including pretty much any video card made since about 1990, and also more fun things like the little i2c display that your toaster has. No need to restrict relatively simple software like fbi/fim to running on less hardware by using drm.
        • anthk 22 hours ago
          I used to play videos with the framebuffer just fine and read PDF's with fbpdf2, among watching TV with fbtv and the like. I didn't miss nearly anything, as most games under SDL1/2 can render into FB with

                export SDL_VIDEODRIVER=fbcon 
          
          or

                export SDL_VIDEODRIVER=kmsdrm
          
          And tons of games too, such as Supertux2, Crispy Doom, SDLQuake, FreeCiv-SDL...
          • sylware 21 hours ago
            This is what I meant: kmsdrm.
          • antisol 22 hours ago
            another fun one if you're in an exotic situation and don't have a framebuffer (or if you just want to have some fun by making your games to look worse):

            export SDL_VIDEODRIVER=aalib

            unfortunately it's only SDL1, though

            • capitainenemo 20 hours ago
              export SDL_VIDEODRIVER=caca is more usable for games
              • antisol 20 hours ago
                Oh nice! How did I not know it works with caca?!
                • capitainenemo 17 hours ago
                  Works pretty well even. I wish there was a libchafa variant, and ideally for SDL2.

                  I've even played SC2, The Ur-Quan masters fairly successfully in an ssh session that way. And Frozen Bubble.

    • written-beyond 18 hours ago
      I shudder when I read DRM after building a embedded display raspberry pi build. There was a problem with Raspberry pi kernel incorrectly detected an HDMI display was connected even though I was trying to display to DSI. The only work around I had was to write a kernel module that would disable HDMI as a possible interface.
  • pjmlp 22 hours ago
    More like UNIX and MS-DOS concepts.
  • globalnode 21 hours ago
    this wont work with wayland will it? has to be a raw tty?
    • a96 18 hours ago
      It does say it runs on Gtk or SDL, so I expect it should.

      Though there are also terminal graphics protocols these days. That seems like it would be another neat box to tick.

  • aiiotnoodle 18 hours ago
    A little while ago when I had a free weekend. I decided I would pre-compute some musings of an LLM trapped in a computer, I had a raspberry pi 1 (or maybe b) lieing around that I had a framebuffer screen for. I think it was a non-standard TFT_ILI9325 from Aliexpress.

    The idea is it would display some helplessness comment on the screen like "Help I'm trapped in a computer" etc etc.

    Eventually I got the thing booted with it's original OS image and it was running a custom kernel and had the hardware still attached and worked, but it was very outdated so I decided backup and update it, more of a technical challenge than something practical.

    I gave it a few tries but eventually the screen would stop working, not helped by the thing being quite slow. Updating in place was probably harder than a brand new OS. Eventually I determined that I'd need to build a custom kernel image using a newer version, something I've never done before and for me it was quite difficult and a little before AI had agents and such to help you along.

    I managed to build a custom kernel but the driver for it had been patched out and moved to an optional thing that I had to enable, I was able to build the custom kernel but for some reason the screen wouldn't display anything like it did on the original OS.

    I spent a further few weekends on it working really hard to get this thing to work. Eventually I calmly picked up the screen and intentionally pushed down hard with my thumb breaking the screen irreparably.

    It was destructive yes but the joy I feel even now being free of this frustration is immense.

    I said I would order a newer screen but have yet to do so.

  • kevinten10 23 hours ago
    [dead]
  • mnkylikeskbd 23 hours ago
    Related to this are the (rather poorly named) kitty terminals graphics protocol: https://sw.kovidgoyal.net/kitty/graphics-protocol/

    Yeah it is playful and all, but telling your colleagues to use "kitty" doesn't sound very professional. You might disagree with this, but that doesn't change the overall perception and general take in corporate world.

    • bschwindHN 22 hours ago
      Did you just... make a new account just to say the word "kitty" is "unprofessional"?
    • opan 22 hours ago
      The name "kitty" is nothing compared to the attitude and crimes of the dev (destroying bitmap support and telling people to buy new monitors). I will never use, support, or recommend kitty.
      • gbin 22 hours ago
        A crime?! Please people I don't even know what happened here but removing some bitmap support is a crime now for a maintainer of an open source piece of code? You are not happy with the project then where is your fork so we can assign some crimes to you and get out of our way to not recommend it? (Note: I am not affiliated at all with the project and I don't even know what happened but you really need to take a breather, no one forced you to use kitty)
        • opan 22 hours ago
          >where is your fork

          Luckily there are better terminal emulators out there, such as foot, so a fork is not necessary.

        • dirasieb 17 hours ago
          hyperbole exists
      • moritonal 22 hours ago
        Interesting you say the Dev isn't a great person, because I had a hunch when I saw the use of the Lena photo on the front page (https://pursuit.unimelb.edu.au/articles/it-s-time-to-retire-...). It's interesting how small gestures present how someone sees the world.
        • miki_oomiri 21 hours ago
          Man… you guys are ruthless. The dude provides a free tool to use, and used a cute named, have opinions about code, and used the most common used photo on his webpage, and suddenly he gets insulted on a public forum by strangers. He's not perfect. Nobody is. He has opinions, and might not even know about Lenna.

          You people are gross.

          • patates 21 hours ago
            As a reply to this comment:

            > Interesting you say the Dev isn't a great person, because I had a hunch when I saw the use of the Lena photo on the front page

            You say:

            > you guys are ruthless (...) You people are gross.

            I'm not saying you don't have a point. I didn't know enough to be sensitive on the Lena topic once either, and could have been the target of the above comment. So I think, perhaps, those could have been formulated more constructively.

            However, I must say the same for your comment too. Can't we all be friends here? :)

            • fc417fc802 11 hours ago
              > I didn't know enough to be sensitive on the Lena topic once either

              It's reactionary nonsense, there's nothing to be sensitive about. The subject of the photograph merely went along with it.

              There are legitimate arguments against using it as a technical benchmark in this day and age but that isn't what people get outraged over.

              My personal view is that the correct response to strangers trying to score social points by policing other's conduct is to defiantly do the opposite.

              • aaplok 5 hours ago
                I agree that calling someone a bad person for using one of the most common test images is excessive. However, regarding this:

                > The subject of the photograph merely went along with it.

                The subject of the photograph did ask for it to no longer be used. Here's a quote from her:

                > I retired from modeling a long time ago. It’s time I retired from tech, too.

                > to defiantly do the opposite.

                If the policing comes from third party for virtue signalling, this is fair game. Here, I'd just suggest that respecting her wish is just common courtesy and consider someone who defiantly doesn't as a somewhat rude person.

                [0] https://interestingengineering.com/culture/bye-lenna-iconic-...

                • fc417fc802 4 hours ago
                  Yes, I'm aware of her statement. My view is that she merely went along with what I see as reactionary nonsense as opposed to actually caring about the use of her likeness. We all have a civic duty to actively push back against the spread of polarizing reactionary movements.

                  Even if I believed her request to be genuine I can't bring myself to view reproducing a commercial image of a professional model that's in widespread circulation as being unethical under any circumstances. Neither would I ever agree to stop distributing a well known book if one day many years later the author woke up suddenly wanting to undo its publication. If you find my viewpoint confusing or seemingly unreasonable, for reference I view projects such as Anna's Archive in a positive light.

                  While I strongly disagree with what I perceive to be the intent behind the image being banned by many journals, I nonetheless agree with the outcome. It's an objectively poor test image for demonstrating the technical capabilities of the vast majority of modern applications. We don't benchmark modern video codecs by encoding VHS rips of classic Disney movies and we shouldn't do the equivalent for still images.

          • redeeman 14 hours ago
            nothing wrong with using that photo, some people just have to chill out. its like people crying snot over master branches
        • hagbard_c 21 hours ago
          Sure, you can 'see' how 'someone sees the world' just by him or her not abiding to the current narrative. You do realise that the 'Lena' image has been the standard image for these purposes for decades and that some people might not consider the (politically charged) crusade to suddenly ban it from all such use as being the most pressing issue?

          I think what you wrote here says more about how you see the world than how Goyal sees it.

          • moritonal 20 hours ago
            You're right my comment was off the cuff but I stand by it's logic. I didn't say Kovid was a terrible person, just not great. Having not done research into him specifically I just noted with the parent that certain qualities such as supposed abrasiveness often overlap with qualities I dislike, like using the Lenna image.

            My point is that using the Lenna image is a signal, just as you rightly point out so is my comment. I know exactly what the image is and is used for. But I also think it's sad that it's politically charged to say using a Playboy image in a literally objectifying fashion as a test-subject by a women who's requested we don't use it is bad.

            It's not a sudden ban, it's been an issue since ~2015. Fun fact I learnt in this, Goyal is totally open to changing it (https://github.com/kovidgoyal/kitty/issues/661), it's simply no-one changed it. I'll see if I can, thanks for the correct call-out.

            • prmoustache 19 hours ago
              > using a Playboy image

              In all honesty, until I read about that I couldn't have imagined the original was a playboy image. What is really used and we see online is a cropped portrait of a playboy image. I am not even sure that playboy image may have been pornographic. Nudity != porn. What is sure is that cropped portrait is not in any way pornographic.

              So I kind of have difficulties on drawing opinions about that. Surely the model doesn't have any copyright on that photo, rather the photographer/publisher have and apparently nobody has cared. I would not use it today out of empathy given the model would rather not see her image still being used today and how easy it is to replace it. I feel that consent is above copyright laws.

              I have mixed feeling about the argument that the presence of that totally non pornographic portrait would make women feel less welcomed in science. On one hand I would say that if they say so, that could be true. On another hand I would ask if these women really are representative of all women? Does it really matters? Should we avoid posting picture of portraits and stick to animals or still life scenes? And if not why should we avoid only women ones?

              • moritonal 17 hours ago
                Personally I consider the crop part of the problem. By cropping (rather than just picking another image) it "cleans" the image, but retains the context. I could crop many images to be valid as test-images, but people who know the context would still see them for what they are. Lenna represents a time when the highest quality magazine at hand in a laboratory was softcore pornography.
            • hagbard_c 20 hours ago
              Using the 'Lena' image is only a signal for those who want to signal something. For most people it is just the standard graphic to use when presenting image processing software. There has been a movement to ban the image but that movement is most likely not nearly so widespread as some people seem to think it is. It wholly depends on which 'bubble' you are in whether using that image is a deadly sin or just daily routine. I suspect Goyal used it in the latter way, not to send some signal to the Image Inquisition.
              • moritonal 18 hours ago
                I want to point out some of the language you've used. You've brought up "current narrative", "crusade", "sin" and "inquisition", when really you seem to be saying "the image doesn't signal anything and the push to remove it is overblown". I disagree with you (for example IEEE has banned it) but I do respect you believe the actual movement that disagrees with is small but influential.

                Instead however I would ask you look at the words you used, where they came from, who said them to you, and why you brought them up here. They are strangely charged words for a debate over a picture.

                • redeeman 14 hours ago
                  > for example IEEE has banned it

                  yeah, so that tells us a lot about the yes-men at IEEE. I wonder what other current-thing they will follow when it suddenly becomes politically convenient.

                  • blipvert 13 hours ago
                    Well, it’s good to know that it’s not just women that you think are unable to make their own decisions.
                • joquarky 15 hours ago
        • redsocksfan45 22 hours ago
          [dead]
    • roer 23 hours ago
      The graphics protocol might be relevant, but I fail to see how the rest of your comment is.
    • krautsauer 19 hours ago
      If we're going the see-also way: sixels. Especially timg for image viewing. I've also played with https://github.com/cptpiepmatz/nu-jupyter-kernel/tree/main/c... which can be neat but the invocation is terribly clunky.
    • chiffaa 17 hours ago
      A lot of software projects have names ranging from silly associations to very cheesy puns, and IMO this should never discourage anyone - everyone should have some whimsy when naming things, because it makes names more memorable. After all, people use Python, and name doesn't even refer to snakes!

      I personally wouldn't be able to remember "kitty" if it was named "featureful-python-terminal-emulator", and I certainly wouldn't want to recommend it to others under this name

    • debazel 19 hours ago
      Good. More open source tools should be unappealing the the "corporate world". They can fund and pay for their own tooling.
    • mghackerlady 18 hours ago
      I like it, it's a pun and a cool animal. GNU has a rather silly name (a gnu is an animal and GNU is an acronym for GNUs Not Unix) but it's done just fine
    • dspillett 21 hours ago
      As much as there are issues people have with kitty's creator/maintainer, which are easy to search for so I'll not reiterate them, choosing a slightly cutesy name is hardly a massively unprofessional act. It isn't like it is called Completely Uncomfortably Named TTY or similar… If you are so uptight that you can't cope with the word “kitty” being used to refer to a protocol, then maybe call it “kay-eye-tee-tee-why” instead?

      > but that doesn't change the overall perception and general take in corporate world.

      It may come as a shock to you, but many don't really care about the feelings of the corporate world, away from our day jobs. Heck, some of us struggle to care in our day jobs! Luckily my corporate overlords and immediate management are not quite so sensitive.

    • Chaosvex 22 hours ago
      Wait until you find out about Git.
      • mnw21cam 20 hours ago
        Yeah, but that one's ok because it's just named after the guy who wrote it.
        • rlopezcc 19 hours ago
          Ah yes, renowned Git Torvalds.
          • Chaosvex 7 hours ago
            Look up the origin of the name and you'll understand.
      • cout 6 hours ago
        Or GIMP.
      • sophacles 10 hours ago
        What do you mean? There's some problem with the old english word for "you two"?

        When did dual forms become problematic?

        • Chaosvex 7 hours ago
          Git is a decidedly British insult and that was the definition being used when Linus named it. He jokes that he named it after himself.