Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to store a image quickly?

How to store a image quickly?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.6k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    MartinChan 0
    wrote on last edited by
    #1

    Recently I am writing a program to generate a 1920*1080 image,but I find that to use QImage::save() method costs like 0.44s to store a pic,so is there any way to save images more quickly in Qt?Should I try to use a QDataStream to write data to a QFile?

    jsulmJ 1 Reply Last reply
    0
    • M MartinChan 0

      Recently I am writing a program to generate a 1920*1080 image,but I find that to use QImage::save() method costs like 0.44s to store a pic,so is there any way to save images more quickly in Qt?Should I try to use a QDataStream to write data to a QFile?

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

      @MartinChan-0 How exactly are you storing the image? What is the device where you store it (hard-disk, SSD,...)?

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

      M 1 Reply Last reply
      1
      • jsulmJ jsulm

        @MartinChan-0 How exactly are you storing the image? What is the device where you store it (hard-disk, SSD,...)?

        M Offline
        M Offline
        MartinChan 0
        wrote on last edited by
        #3

        @jsulm I created a QImage and store it under my output folder(hard-disk)...

        jsulmJ 1 Reply Last reply
        0
        • M MartinChan 0

          @jsulm I created a QImage and store it under my output folder(hard-disk)...

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

          @MartinChan-0 You actually didn't answer any of my questions.
          How do you know that QImage::save() takey 0.44sec? How did you measure?

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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MartinChan 0
            wrote on last edited by
            #5

            Sorry...I use qt_windows.h functions "QueryPerformanceCounter" to calculate it.

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

              Hi,

              What image format are you using to save your images ?

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

              M 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                What image format are you using to save your images ?

                M Offline
                M Offline
                MartinChan 0
                wrote on last edited by
                #7

                @SGaist .png,maybe it could be faster when i use .jpg?

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

                  Well, you are using an format that requires compression so you have to benchmark a bit more. IIRC, there's an implementation of the jpeg library call libjpeg-turbo that should be faster but you will have to re-built the jpg image plugin yourself to make use of it.

                  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

                  • Login

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