Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Loading Images with small CPU load
Forum Update on Monday, May 27th 2025

Loading Images with small CPU load

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 6 Posters 2.0k Views
  • 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 Offline
    S Offline
    Snoopy
    wrote on last edited by
    #1

    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

    JKSHJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • S Offline
        S Offline
        Snoopy
        wrote on last edited by
        #3

        I'm using images in PNG-Format

        jsulmJ 1 Reply Last reply
        0
        • S Snoopy

          I'm using images in PNG-Format

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Snoopy PNG is compressed

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

          1 Reply Last reply
          0
          • timdayT Offline
            timdayT Offline
            timday
            wrote on last edited by
            #5

            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
            2
            • S Snoopy

              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

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              @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
              0
              • JKSHJ JKSH

                @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/ ?

                S Offline
                S Offline
                Snoopy
                wrote on last edited by
                #7

                @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
                1
                • Pablo J. RoginaP Offline
                  Pablo J. RoginaP Offline
                  Pablo J. Rogina
                  wrote on last edited by
                  #8

                  @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
                  -1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved