Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Loading Images with small CPU load

    Mobile and Embedded
    6
    8
    1590
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Snoopy last edited by

      Hello,

      Has somebody experience what's the best or correct way for image loading with preferably a small CPU load ?
      Because it's an embedded system I've to get along with a not very powerfull CPU.

      I've over hundred images as png-Files. Everyone with size of 300 x 300 Pixel
      In my usecase every 100 ms I've to replace an image with a new one. For the intervall I'm using a timer.

      Can somebody give a tip ?

      Thanks and best regards,

      snoopy

      JKSH 1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Depending on what these images you should avoid using a compressed format.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • S
          Snoopy last edited by

          I'm using images in PNG-Format

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @Snoopy last edited by

            @Snoopy PNG is compressed

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • timday
              timday last edited by

              That much image data would be ~205MByte stored uncompressed (at 24bits/pixel) per hundred images. Might be a lot for an embedded system? But if you've got the storage available you could just store the raw image data into files and load when needed and point a QImage at the data. (Or memory-mapping the image data might be better depending whether usage patterns and available RAM lead to some caching and re-use of already loaded data).

              1 Reply Last reply Reply Quote 2
              • JKSH
                JKSH Moderators @Snoopy last edited by

                @Snoopy said in Loading Images with small CPU load:

                For the intervall I'm using a timer.

                How far did you get with the advice you got from https://forum.qt.io/topic/87537/need-a-timer-which-works-exactly/ ?

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                S 1 Reply Last reply Reply Quote 0
                • S
                  Snoopy @JKSH last edited by

                  @JKSH

                  I've detected that in my case the QML Timer was the problem and not loading the images. The Timer himself is imprecise. I've checked it by comparing the elapsed time with the system time of the PC.
                  One more example: If there is only running the timer with an interval of 100 ms (without loading images), and I'm moving the mouse the triggeredEvents will be fired only after 180 ms in average.

                  Now I've integrated the QTimer based on C++ into my QML-code. I'm using the QTimer with type PreciseTimer.
                  This works very fine.

                  In combination with loading images I've opened a new topic
                  https://forum.qt.io/topic/87826/caching-many-png-images-files-in-one-go
                  I would be very gratefull If you could look inside it. Maybe you have experience with this topic.

                  Thanks.

                  Best regards

                  Snoopy

                  1 Reply Last reply Reply Quote 1
                  • Pablo J. Rogina
                    Pablo J. Rogina last edited by

                    @Snoopy you may want to take a look at a series of blog posts regarding Fast-Booting Qt Devices. Although some items covered there might not apply to you, some tips about do's and do not's could be relevant.

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply Reply Quote -1
                    • First post
                      Last post