Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Convert TIFF to bmp

Convert TIFF to bmp

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 4 Posters 0 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.
  • R Offline
    R Offline
    Romiks
    wrote on last edited by
    #1

    Hi all, I need to convert tiff file to bmp file. I found libtiff library. Maybe anybody using this library? If it possable, give me some ideas how to do that? (TIFF encoded to CMYK)

    C C 2 Replies Last reply
    0
    • R Romiks

      Hi all, I need to convert tiff file to bmp file. I found libtiff library. Maybe anybody using this library? If it possable, give me some ideas how to do that? (TIFF encoded to CMYK)

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      the easiest way to use LibTiff is with its RGBA interface: it goes something like this:

      TIFF *tif = TIFFOpen(...)
      UINT32 width, height;
      TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
      TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);

      if (TIFFRGBAImageOK(tif, msg)==0)
      {
      BYTE * pBuffer = new BYTE[w * h * 4];

      TIFFReadRGBAImage(tif, width, height, pBuffer, 1);

      ... etc
      }

      TIFFClose(tif)

      and then you will have an RGBA image from your TIFF file... but, there are plenty of libraries out there that can do all of for you.

      image processing toolkits | batch image processing

      R 1 Reply Last reply
      0
      • R Romiks

        Hi all, I need to convert tiff file to bmp file. I found libtiff library. Maybe anybody using this library? If it possable, give me some ideas how to do that? (TIFF encoded to CMYK)

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Doesn't GDI+ do this for you ?

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        1 Reply Last reply
        0
        • C Chris Losinger

          the easiest way to use LibTiff is with its RGBA interface: it goes something like this:

          TIFF *tif = TIFFOpen(...)
          UINT32 width, height;
          TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
          TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);

          if (TIFFRGBAImageOK(tif, msg)==0)
          {
          BYTE * pBuffer = new BYTE[w * h * 4];

          TIFFReadRGBAImage(tif, width, height, pBuffer, 1);

          ... etc
          }

          TIFFClose(tif)

          and then you will have an RGBA image from your TIFF file... but, there are plenty of libraries out there that can do all of for you.

          image processing toolkits | batch image processing

          R Offline
          R Offline
          Romiks
          wrote on last edited by
          #4

          Many thanks :), I'll try it.

          but, there are plenty of libraries out there that can do all of for you.

          I need it for my cross-platform application, which uses wxWidgets library.

          R J 2 Replies Last reply
          0
          • R Romiks

            Many thanks :), I'll try it.

            but, there are plenty of libraries out there that can do all of for you.

            I need it for my cross-platform application, which uses wxWidgets library.

            R Offline
            R Offline
            Romiks
            wrote on last edited by
            #5

            Now I need to show TIFF, but I have another problem with scalling the image. Is it possable to scale the image by libtiff? My TIFF is width:13700; height:9300.

            1 Reply Last reply
            0
            • R Romiks

              Many thanks :), I'll try it.

              but, there are plenty of libraries out there that can do all of for you.

              I need it for my cross-platform application, which uses wxWidgets library.

              J Offline
              J Offline
              JudyL_MD
              wrote on last edited by
              #6

              Romiks wrote:

              I need it for my cross-platform application, which uses wxWidgets library

              I haven't tried it, but could you use the wxImage class to open the TIFF file and then save it as a BMP file?

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups