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. Simple 8bpp Image modifying [modified]

Simple 8bpp Image modifying [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
performancehelptutorialquestion
4 Posts 3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I have been digging a while and can not find much. I want to find something that shows how to open and modify a 8bpp image in memory and then save it back out (somewhere else). Most 'simple' things I find have 24bpp and it seems the header information is much different... Atleast after my save ImageJ fails opening the image so I assume it is different. Can someone post a link or some code that can help me. Thank you in advance. Found something very useful! 4 pages deep on my google search (oh google.. you use to be so good at knowing what I wanted. What happend?) Simple Image Class Library[^]

    Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

    modified on Wednesday, September 8, 2010 11:28 AM

    C N 2 Replies Last reply
    0
    • L Lost User

      I have been digging a while and can not find much. I want to find something that shows how to open and modify a 8bpp image in memory and then save it back out (somewhere else). Most 'simple' things I find have 24bpp and it seems the header information is much different... Atleast after my save ImageJ fails opening the image so I assume it is different. Can someone post a link or some code that can help me. Thank you in advance. Found something very useful! 4 pages deep on my google search (oh google.. you use to be so good at knowing what I wanted. What happend?) Simple Image Class Library[^]

      Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

      modified on Wednesday, September 8, 2010 11:28 AM

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Could you post your code? Maybe we can help you to fix it. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      L 1 Reply Last reply
      0
      • C CPallini

        Could you post your code? Maybe we can help you to fix it. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I needed a starting point. That was my point. It has been a while since I had even used C++ so I was having major set up issues. Anyways I found something... I will put it in my original post. Thanks anyways.

        Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

        1 Reply Last reply
        0
        • L Lost User

          I have been digging a while and can not find much. I want to find something that shows how to open and modify a 8bpp image in memory and then save it back out (somewhere else). Most 'simple' things I find have 24bpp and it seems the header information is much different... Atleast after my save ImageJ fails opening the image so I assume it is different. Can someone post a link or some code that can help me. Thank you in advance. Found something very useful! 4 pages deep on my google search (oh google.. you use to be so good at knowing what I wanted. What happend?) Simple Image Class Library[^]

          Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

          modified on Wednesday, September 8, 2010 11:28 AM

          N Offline
          N Offline
          normanS
          wrote on last edited by
          #4

          I've never had to work with 8 bit per pixel images, but they are fundamentally different from 16 bpp or 24 bpp images. And 24 bpp images are easier to work with in some ways! In a 24 bpp image (as I'm sure you know), you have a byte each for intensity of red, green, and blue components. In an 8bpp image, each pixel's byte does not contain a value which can be directly interpretted as a colour value. Instead, the pixel contains an index to the pallette, where the pallette is effectively a 256-element array of 24 bpp colour values (I seem to remember that there is something peculiar in the palette, so maybe it is 240 element not 256 element, where 16 elements are "system colours" and have fixed values, or something like that.) Have a look at the MSDN SAVEBMP.C example. It's painful but it will work! (But I'm really glad I only ever had to save 16bpp and 24bpp images based on SDK examples like this.)

          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