can I display a JPG or PNG to the framebuffer (/dev/fb*)?












17















I know I can capture the framebuffer in linux using something like cp /dev/fb0 ~/myimage and re-display that by coping back to the device like so cp ~/myimage /dev/fb0. What format is the framebuffer image data in? and how would I go about displaying a pre-made image (jpg, png) to the framebuffer? Can I convert to this format using imagemagick?



p.s. Im using a raspberry pi running raspbian.





Update 11-12-2012



I ended up using pygame to display images in my application. Not sure if this uses the frame-buffer to display the images. But it meets my needs quite well.










share|improve this question





























    17















    I know I can capture the framebuffer in linux using something like cp /dev/fb0 ~/myimage and re-display that by coping back to the device like so cp ~/myimage /dev/fb0. What format is the framebuffer image data in? and how would I go about displaying a pre-made image (jpg, png) to the framebuffer? Can I convert to this format using imagemagick?



    p.s. Im using a raspberry pi running raspbian.





    Update 11-12-2012



    I ended up using pygame to display images in my application. Not sure if this uses the frame-buffer to display the images. But it meets my needs quite well.










    share|improve this question



























      17












      17








      17


      3






      I know I can capture the framebuffer in linux using something like cp /dev/fb0 ~/myimage and re-display that by coping back to the device like so cp ~/myimage /dev/fb0. What format is the framebuffer image data in? and how would I go about displaying a pre-made image (jpg, png) to the framebuffer? Can I convert to this format using imagemagick?



      p.s. Im using a raspberry pi running raspbian.





      Update 11-12-2012



      I ended up using pygame to display images in my application. Not sure if this uses the frame-buffer to display the images. But it meets my needs quite well.










      share|improve this question
















      I know I can capture the framebuffer in linux using something like cp /dev/fb0 ~/myimage and re-display that by coping back to the device like so cp ~/myimage /dev/fb0. What format is the framebuffer image data in? and how would I go about displaying a pre-made image (jpg, png) to the framebuffer? Can I convert to this format using imagemagick?



      p.s. Im using a raspberry pi running raspbian.





      Update 11-12-2012



      I ended up using pygame to display images in my application. Not sure if this uses the frame-buffer to display the images. But it meets my needs quite well.







      linux images raspberry-pi framebuffer






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '12 at 1:29







      ndmweb

















      asked Oct 30 '12 at 4:01









      ndmwebndmweb

      211235




      211235






















          6 Answers
          6






          active

          oldest

          votes


















          7














          Have you tried Fbida?



          fbida contains fbi, an image viewer for the framebuffer.



          Link to fbi man page - http://manpages.ubuntu.com/manpages/lucid/man1/fbi.1.html



          P.S - I am not sure whether it will work in Raspbian.






          share|improve this answer
























          • Unfortunately it doesn't seem to be possible to prevent 'fbi' from displaying a status bar at the bottom of the screen. This is a bit of a showstopper for various applications...

            – Jules
            May 23 '13 at 7:46






          • 3





            @Jules On Debian 8 (testing), there is a -noverbose option which makes it display just the image itself; however, this is not documented in the man page, but is only in the "usage:" for the it.

            – Abbafei
            Jun 23 '13 at 8:32











          • Does it work? I previously built a copy from the source on the author's web page, and that did have the option, but the option did not seem to actually do anything at all in that version.

            – Jules
            Jun 27 '13 at 16:54











          • @Jules -noverbose works for me using fbi on raspbian when I installed it using apt-get install fbi.

            – D. Woods
            Jul 30 '13 at 9:12





















          3














          it might help you, detailed manual http://hacklab.cz/2012/04/22/usefulness-linux-framebuffer-virtual-console I think it has all in one place about Linux Framebuffer






          share|improve this answer































            2















            What format is the framebuffer image data in?




            The Linux kernel 4.2 documentation https://github.com/torvalds/linux/blob/v4.2/Documentation/fb/api.txt#45 says:




            Pixels are stored in memory in hardware-dependent formats. Applications need
            to be aware of the pixel storage format in order to write image data to the
            frame buffer memory in the format expected by the hardware.



            Formats are described by frame buffer types and visuals. Some visuals require
            additional information, which are stored in the variable screen information
            bits_per_pixel, grayscale, red, green, blue and transp fields.



            Visuals describe how color information is encoded and assembled to create
            macropixels. Types describe how macropixels are stored in memory. The following types and visuals are supported.




            A list of visuals and types follows, but the description is not enough for me to understand the exact formats immediately.






            share|improve this answer



















            • 1





              @Downvoters please explain so I can learn and improve info. I never retaliate. Thanks.

              – Ciro Santilli 新疆改造中心 六四事件 法轮功
              Apr 19 '17 at 12:18



















            1














            If you want to cp /dev/fb0 ~/myimage, the image should only contain the pixels information,and the order should be right (RGB, BGR, RGBA, ARGB...)



            I want to do this too,but did not find a suitable tool, so I use python to help me pre-made the image. You can try this.






            share|improve this answer

































              0














              If you can install them, fbcat will create a ppm image, and fbgrab will create a png image.






              share|improve this answer































                0














                Look at /usr/include/linux/fb.h at structs like fb_var_screeninfo. There can be a variety of color depths and formats. I see 16 bits/pixel way too often, right now I have 32. Type fbset by itself and it will display the current settings. Which will almost certainly be one of the entries in /etc/fb.modes.



                upstairs# fbset

                mode "1920x1080"
                geometry 1920 1080 1920 1080 32
                timings 0 0 0 0 0 0 0
                rgba 8/16,8/8,8/0,8/24
                endmode


                Imagemagick might work if you can make it match exactly the mode you need. I'd probably write something in C, a dozen or so lines calling libjpeg or libpng can decompress an image into a memory array. Your bits/color etc. needs to match or you need to write something to convert it. Good experience.



                Also rather than reading/writing /dev/fb0 as a file, open() it to get a file descriptor then mmap() it so you're working with a pointer to the memory. It's much faster at doing transfers, at least 10x.



                But for putting images on the screen I just install qiv. Then hit F1 for help, but an x while displaying an image will write it semi-permanently to the root window if that's what you want. Or just set it as wallpaper in Desktop Preferences and it will come up every boot.






                share|improve this answer


























                • Mine's ARGB apparently (Raspbian). I started with HTML-type colors from a GIMP color picker, took 4 tries to get it right.

                  – Alan Corey
                  Feb 20 at 19:36














                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "3"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f495948%2fcan-i-display-a-jpg-or-png-to-the-framebuffer-dev-fb%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                6 Answers
                6






                active

                oldest

                votes








                6 Answers
                6






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                7














                Have you tried Fbida?



                fbida contains fbi, an image viewer for the framebuffer.



                Link to fbi man page - http://manpages.ubuntu.com/manpages/lucid/man1/fbi.1.html



                P.S - I am not sure whether it will work in Raspbian.






                share|improve this answer
























                • Unfortunately it doesn't seem to be possible to prevent 'fbi' from displaying a status bar at the bottom of the screen. This is a bit of a showstopper for various applications...

                  – Jules
                  May 23 '13 at 7:46






                • 3





                  @Jules On Debian 8 (testing), there is a -noverbose option which makes it display just the image itself; however, this is not documented in the man page, but is only in the "usage:" for the it.

                  – Abbafei
                  Jun 23 '13 at 8:32











                • Does it work? I previously built a copy from the source on the author's web page, and that did have the option, but the option did not seem to actually do anything at all in that version.

                  – Jules
                  Jun 27 '13 at 16:54











                • @Jules -noverbose works for me using fbi on raspbian when I installed it using apt-get install fbi.

                  – D. Woods
                  Jul 30 '13 at 9:12


















                7














                Have you tried Fbida?



                fbida contains fbi, an image viewer for the framebuffer.



                Link to fbi man page - http://manpages.ubuntu.com/manpages/lucid/man1/fbi.1.html



                P.S - I am not sure whether it will work in Raspbian.






                share|improve this answer
























                • Unfortunately it doesn't seem to be possible to prevent 'fbi' from displaying a status bar at the bottom of the screen. This is a bit of a showstopper for various applications...

                  – Jules
                  May 23 '13 at 7:46






                • 3





                  @Jules On Debian 8 (testing), there is a -noverbose option which makes it display just the image itself; however, this is not documented in the man page, but is only in the "usage:" for the it.

                  – Abbafei
                  Jun 23 '13 at 8:32











                • Does it work? I previously built a copy from the source on the author's web page, and that did have the option, but the option did not seem to actually do anything at all in that version.

                  – Jules
                  Jun 27 '13 at 16:54











                • @Jules -noverbose works for me using fbi on raspbian when I installed it using apt-get install fbi.

                  – D. Woods
                  Jul 30 '13 at 9:12
















                7












                7








                7







                Have you tried Fbida?



                fbida contains fbi, an image viewer for the framebuffer.



                Link to fbi man page - http://manpages.ubuntu.com/manpages/lucid/man1/fbi.1.html



                P.S - I am not sure whether it will work in Raspbian.






                share|improve this answer













                Have you tried Fbida?



                fbida contains fbi, an image viewer for the framebuffer.



                Link to fbi man page - http://manpages.ubuntu.com/manpages/lucid/man1/fbi.1.html



                P.S - I am not sure whether it will work in Raspbian.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 30 '12 at 6:16









                VenkatHVenkatH

                571214




                571214













                • Unfortunately it doesn't seem to be possible to prevent 'fbi' from displaying a status bar at the bottom of the screen. This is a bit of a showstopper for various applications...

                  – Jules
                  May 23 '13 at 7:46






                • 3





                  @Jules On Debian 8 (testing), there is a -noverbose option which makes it display just the image itself; however, this is not documented in the man page, but is only in the "usage:" for the it.

                  – Abbafei
                  Jun 23 '13 at 8:32











                • Does it work? I previously built a copy from the source on the author's web page, and that did have the option, but the option did not seem to actually do anything at all in that version.

                  – Jules
                  Jun 27 '13 at 16:54











                • @Jules -noverbose works for me using fbi on raspbian when I installed it using apt-get install fbi.

                  – D. Woods
                  Jul 30 '13 at 9:12





















                • Unfortunately it doesn't seem to be possible to prevent 'fbi' from displaying a status bar at the bottom of the screen. This is a bit of a showstopper for various applications...

                  – Jules
                  May 23 '13 at 7:46






                • 3





                  @Jules On Debian 8 (testing), there is a -noverbose option which makes it display just the image itself; however, this is not documented in the man page, but is only in the "usage:" for the it.

                  – Abbafei
                  Jun 23 '13 at 8:32











                • Does it work? I previously built a copy from the source on the author's web page, and that did have the option, but the option did not seem to actually do anything at all in that version.

                  – Jules
                  Jun 27 '13 at 16:54











                • @Jules -noverbose works for me using fbi on raspbian when I installed it using apt-get install fbi.

                  – D. Woods
                  Jul 30 '13 at 9:12



















                Unfortunately it doesn't seem to be possible to prevent 'fbi' from displaying a status bar at the bottom of the screen. This is a bit of a showstopper for various applications...

                – Jules
                May 23 '13 at 7:46





                Unfortunately it doesn't seem to be possible to prevent 'fbi' from displaying a status bar at the bottom of the screen. This is a bit of a showstopper for various applications...

                – Jules
                May 23 '13 at 7:46




                3




                3





                @Jules On Debian 8 (testing), there is a -noverbose option which makes it display just the image itself; however, this is not documented in the man page, but is only in the "usage:" for the it.

                – Abbafei
                Jun 23 '13 at 8:32





                @Jules On Debian 8 (testing), there is a -noverbose option which makes it display just the image itself; however, this is not documented in the man page, but is only in the "usage:" for the it.

                – Abbafei
                Jun 23 '13 at 8:32













                Does it work? I previously built a copy from the source on the author's web page, and that did have the option, but the option did not seem to actually do anything at all in that version.

                – Jules
                Jun 27 '13 at 16:54





                Does it work? I previously built a copy from the source on the author's web page, and that did have the option, but the option did not seem to actually do anything at all in that version.

                – Jules
                Jun 27 '13 at 16:54













                @Jules -noverbose works for me using fbi on raspbian when I installed it using apt-get install fbi.

                – D. Woods
                Jul 30 '13 at 9:12







                @Jules -noverbose works for me using fbi on raspbian when I installed it using apt-get install fbi.

                – D. Woods
                Jul 30 '13 at 9:12















                3














                it might help you, detailed manual http://hacklab.cz/2012/04/22/usefulness-linux-framebuffer-virtual-console I think it has all in one place about Linux Framebuffer






                share|improve this answer




























                  3














                  it might help you, detailed manual http://hacklab.cz/2012/04/22/usefulness-linux-framebuffer-virtual-console I think it has all in one place about Linux Framebuffer






                  share|improve this answer


























                    3












                    3








                    3







                    it might help you, detailed manual http://hacklab.cz/2012/04/22/usefulness-linux-framebuffer-virtual-console I think it has all in one place about Linux Framebuffer






                    share|improve this answer













                    it might help you, detailed manual http://hacklab.cz/2012/04/22/usefulness-linux-framebuffer-virtual-console I think it has all in one place about Linux Framebuffer







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 18 '12 at 10:23









                    MichaelHefnerMichaelHefner

                    512




                    512























                        2















                        What format is the framebuffer image data in?




                        The Linux kernel 4.2 documentation https://github.com/torvalds/linux/blob/v4.2/Documentation/fb/api.txt#45 says:




                        Pixels are stored in memory in hardware-dependent formats. Applications need
                        to be aware of the pixel storage format in order to write image data to the
                        frame buffer memory in the format expected by the hardware.



                        Formats are described by frame buffer types and visuals. Some visuals require
                        additional information, which are stored in the variable screen information
                        bits_per_pixel, grayscale, red, green, blue and transp fields.



                        Visuals describe how color information is encoded and assembled to create
                        macropixels. Types describe how macropixels are stored in memory. The following types and visuals are supported.




                        A list of visuals and types follows, but the description is not enough for me to understand the exact formats immediately.






                        share|improve this answer



















                        • 1





                          @Downvoters please explain so I can learn and improve info. I never retaliate. Thanks.

                          – Ciro Santilli 新疆改造中心 六四事件 法轮功
                          Apr 19 '17 at 12:18
















                        2















                        What format is the framebuffer image data in?




                        The Linux kernel 4.2 documentation https://github.com/torvalds/linux/blob/v4.2/Documentation/fb/api.txt#45 says:




                        Pixels are stored in memory in hardware-dependent formats. Applications need
                        to be aware of the pixel storage format in order to write image data to the
                        frame buffer memory in the format expected by the hardware.



                        Formats are described by frame buffer types and visuals. Some visuals require
                        additional information, which are stored in the variable screen information
                        bits_per_pixel, grayscale, red, green, blue and transp fields.



                        Visuals describe how color information is encoded and assembled to create
                        macropixels. Types describe how macropixels are stored in memory. The following types and visuals are supported.




                        A list of visuals and types follows, but the description is not enough for me to understand the exact formats immediately.






                        share|improve this answer



















                        • 1





                          @Downvoters please explain so I can learn and improve info. I never retaliate. Thanks.

                          – Ciro Santilli 新疆改造中心 六四事件 法轮功
                          Apr 19 '17 at 12:18














                        2












                        2








                        2








                        What format is the framebuffer image data in?




                        The Linux kernel 4.2 documentation https://github.com/torvalds/linux/blob/v4.2/Documentation/fb/api.txt#45 says:




                        Pixels are stored in memory in hardware-dependent formats. Applications need
                        to be aware of the pixel storage format in order to write image data to the
                        frame buffer memory in the format expected by the hardware.



                        Formats are described by frame buffer types and visuals. Some visuals require
                        additional information, which are stored in the variable screen information
                        bits_per_pixel, grayscale, red, green, blue and transp fields.



                        Visuals describe how color information is encoded and assembled to create
                        macropixels. Types describe how macropixels are stored in memory. The following types and visuals are supported.




                        A list of visuals and types follows, but the description is not enough for me to understand the exact formats immediately.






                        share|improve this answer














                        What format is the framebuffer image data in?




                        The Linux kernel 4.2 documentation https://github.com/torvalds/linux/blob/v4.2/Documentation/fb/api.txt#45 says:




                        Pixels are stored in memory in hardware-dependent formats. Applications need
                        to be aware of the pixel storage format in order to write image data to the
                        frame buffer memory in the format expected by the hardware.



                        Formats are described by frame buffer types and visuals. Some visuals require
                        additional information, which are stored in the variable screen information
                        bits_per_pixel, grayscale, red, green, blue and transp fields.



                        Visuals describe how color information is encoded and assembled to create
                        macropixels. Types describe how macropixels are stored in memory. The following types and visuals are supported.




                        A list of visuals and types follows, but the description is not enough for me to understand the exact formats immediately.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Oct 29 '15 at 10:17









                        Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功

                        4,14322737




                        4,14322737








                        • 1





                          @Downvoters please explain so I can learn and improve info. I never retaliate. Thanks.

                          – Ciro Santilli 新疆改造中心 六四事件 法轮功
                          Apr 19 '17 at 12:18














                        • 1





                          @Downvoters please explain so I can learn and improve info. I never retaliate. Thanks.

                          – Ciro Santilli 新疆改造中心 六四事件 法轮功
                          Apr 19 '17 at 12:18








                        1




                        1





                        @Downvoters please explain so I can learn and improve info. I never retaliate. Thanks.

                        – Ciro Santilli 新疆改造中心 六四事件 法轮功
                        Apr 19 '17 at 12:18





                        @Downvoters please explain so I can learn and improve info. I never retaliate. Thanks.

                        – Ciro Santilli 新疆改造中心 六四事件 法轮功
                        Apr 19 '17 at 12:18











                        1














                        If you want to cp /dev/fb0 ~/myimage, the image should only contain the pixels information,and the order should be right (RGB, BGR, RGBA, ARGB...)



                        I want to do this too,but did not find a suitable tool, so I use python to help me pre-made the image. You can try this.






                        share|improve this answer






























                          1














                          If you want to cp /dev/fb0 ~/myimage, the image should only contain the pixels information,and the order should be right (RGB, BGR, RGBA, ARGB...)



                          I want to do this too,but did not find a suitable tool, so I use python to help me pre-made the image. You can try this.






                          share|improve this answer




























                            1












                            1








                            1







                            If you want to cp /dev/fb0 ~/myimage, the image should only contain the pixels information,and the order should be right (RGB, BGR, RGBA, ARGB...)



                            I want to do this too,but did not find a suitable tool, so I use python to help me pre-made the image. You can try this.






                            share|improve this answer















                            If you want to cp /dev/fb0 ~/myimage, the image should only contain the pixels information,and the order should be right (RGB, BGR, RGBA, ARGB...)



                            I want to do this too,but did not find a suitable tool, so I use python to help me pre-made the image. You can try this.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Dec 16 '16 at 15:26









                            nKn

                            4,61052433




                            4,61052433










                            answered Nov 28 '16 at 14:39









                            zqb-allzqb-all

                            513




                            513























                                0














                                If you can install them, fbcat will create a ppm image, and fbgrab will create a png image.






                                share|improve this answer




























                                  0














                                  If you can install them, fbcat will create a ppm image, and fbgrab will create a png image.






                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    If you can install them, fbcat will create a ppm image, and fbgrab will create a png image.






                                    share|improve this answer













                                    If you can install them, fbcat will create a ppm image, and fbgrab will create a png image.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Oct 30 '15 at 4:07









                                    Yves DorfsmanYves Dorfsman

                                    1653




                                    1653























                                        0














                                        Look at /usr/include/linux/fb.h at structs like fb_var_screeninfo. There can be a variety of color depths and formats. I see 16 bits/pixel way too often, right now I have 32. Type fbset by itself and it will display the current settings. Which will almost certainly be one of the entries in /etc/fb.modes.



                                        upstairs# fbset

                                        mode "1920x1080"
                                        geometry 1920 1080 1920 1080 32
                                        timings 0 0 0 0 0 0 0
                                        rgba 8/16,8/8,8/0,8/24
                                        endmode


                                        Imagemagick might work if you can make it match exactly the mode you need. I'd probably write something in C, a dozen or so lines calling libjpeg or libpng can decompress an image into a memory array. Your bits/color etc. needs to match or you need to write something to convert it. Good experience.



                                        Also rather than reading/writing /dev/fb0 as a file, open() it to get a file descriptor then mmap() it so you're working with a pointer to the memory. It's much faster at doing transfers, at least 10x.



                                        But for putting images on the screen I just install qiv. Then hit F1 for help, but an x while displaying an image will write it semi-permanently to the root window if that's what you want. Or just set it as wallpaper in Desktop Preferences and it will come up every boot.






                                        share|improve this answer


























                                        • Mine's ARGB apparently (Raspbian). I started with HTML-type colors from a GIMP color picker, took 4 tries to get it right.

                                          – Alan Corey
                                          Feb 20 at 19:36


















                                        0














                                        Look at /usr/include/linux/fb.h at structs like fb_var_screeninfo. There can be a variety of color depths and formats. I see 16 bits/pixel way too often, right now I have 32. Type fbset by itself and it will display the current settings. Which will almost certainly be one of the entries in /etc/fb.modes.



                                        upstairs# fbset

                                        mode "1920x1080"
                                        geometry 1920 1080 1920 1080 32
                                        timings 0 0 0 0 0 0 0
                                        rgba 8/16,8/8,8/0,8/24
                                        endmode


                                        Imagemagick might work if you can make it match exactly the mode you need. I'd probably write something in C, a dozen or so lines calling libjpeg or libpng can decompress an image into a memory array. Your bits/color etc. needs to match or you need to write something to convert it. Good experience.



                                        Also rather than reading/writing /dev/fb0 as a file, open() it to get a file descriptor then mmap() it so you're working with a pointer to the memory. It's much faster at doing transfers, at least 10x.



                                        But for putting images on the screen I just install qiv. Then hit F1 for help, but an x while displaying an image will write it semi-permanently to the root window if that's what you want. Or just set it as wallpaper in Desktop Preferences and it will come up every boot.






                                        share|improve this answer


























                                        • Mine's ARGB apparently (Raspbian). I started with HTML-type colors from a GIMP color picker, took 4 tries to get it right.

                                          – Alan Corey
                                          Feb 20 at 19:36
















                                        0












                                        0








                                        0







                                        Look at /usr/include/linux/fb.h at structs like fb_var_screeninfo. There can be a variety of color depths and formats. I see 16 bits/pixel way too often, right now I have 32. Type fbset by itself and it will display the current settings. Which will almost certainly be one of the entries in /etc/fb.modes.



                                        upstairs# fbset

                                        mode "1920x1080"
                                        geometry 1920 1080 1920 1080 32
                                        timings 0 0 0 0 0 0 0
                                        rgba 8/16,8/8,8/0,8/24
                                        endmode


                                        Imagemagick might work if you can make it match exactly the mode you need. I'd probably write something in C, a dozen or so lines calling libjpeg or libpng can decompress an image into a memory array. Your bits/color etc. needs to match or you need to write something to convert it. Good experience.



                                        Also rather than reading/writing /dev/fb0 as a file, open() it to get a file descriptor then mmap() it so you're working with a pointer to the memory. It's much faster at doing transfers, at least 10x.



                                        But for putting images on the screen I just install qiv. Then hit F1 for help, but an x while displaying an image will write it semi-permanently to the root window if that's what you want. Or just set it as wallpaper in Desktop Preferences and it will come up every boot.






                                        share|improve this answer















                                        Look at /usr/include/linux/fb.h at structs like fb_var_screeninfo. There can be a variety of color depths and formats. I see 16 bits/pixel way too often, right now I have 32. Type fbset by itself and it will display the current settings. Which will almost certainly be one of the entries in /etc/fb.modes.



                                        upstairs# fbset

                                        mode "1920x1080"
                                        geometry 1920 1080 1920 1080 32
                                        timings 0 0 0 0 0 0 0
                                        rgba 8/16,8/8,8/0,8/24
                                        endmode


                                        Imagemagick might work if you can make it match exactly the mode you need. I'd probably write something in C, a dozen or so lines calling libjpeg or libpng can decompress an image into a memory array. Your bits/color etc. needs to match or you need to write something to convert it. Good experience.



                                        Also rather than reading/writing /dev/fb0 as a file, open() it to get a file descriptor then mmap() it so you're working with a pointer to the memory. It's much faster at doing transfers, at least 10x.



                                        But for putting images on the screen I just install qiv. Then hit F1 for help, but an x while displaying an image will write it semi-permanently to the root window if that's what you want. Or just set it as wallpaper in Desktop Preferences and it will come up every boot.







                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited Feb 3 at 18:36

























                                        answered Feb 3 at 16:39









                                        Alan CoreyAlan Corey

                                        43




                                        43













                                        • Mine's ARGB apparently (Raspbian). I started with HTML-type colors from a GIMP color picker, took 4 tries to get it right.

                                          – Alan Corey
                                          Feb 20 at 19:36





















                                        • Mine's ARGB apparently (Raspbian). I started with HTML-type colors from a GIMP color picker, took 4 tries to get it right.

                                          – Alan Corey
                                          Feb 20 at 19:36



















                                        Mine's ARGB apparently (Raspbian). I started with HTML-type colors from a GIMP color picker, took 4 tries to get it right.

                                        – Alan Corey
                                        Feb 20 at 19:36







                                        Mine's ARGB apparently (Raspbian). I started with HTML-type colors from a GIMP color picker, took 4 tries to get it right.

                                        – Alan Corey
                                        Feb 20 at 19:36




















                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Super User!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f495948%2fcan-i-display-a-jpg-or-png-to-the-framebuffer-dev-fb%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Сан-Квентин

                                        Алькесар

                                        Josef Freinademetz