ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    HCI & Computer Graphics
    COMP3145
    Progress0 / 73 topics
    Topics
    1. The Human: Input-output channels2. Human memory3. Thinking, Reasoning, Problem solving4. Emotions and Individual differences5. Psychology and design of interacting systems6. The Computer: Text entry devices7. Positioning, Pointing, and drawing devices8. Display devices9. Devices for virtual reality and 3D interaction10. Physical controls, Sensors and special devices11. Paper printing and scanning12. Memory, Processing and networks13. The Interaction: Models of interaction14. Frameworks and HCI15. Ergonomics16. Interaction styles17. Elements of the WIMP interfaces18. Interactivity and Context of interaction19. Usability Paradigm and Principles: Introduction20. Paradigms for interaction21. Interaction Design Basics: What is design22. Process of design and User focus23. Navigation design24. Screen design and layout25. Iteration and prototyping26. HCI in Software Process: Software life cycle27. Usability engineering28. Iterative design and prototyping29. Design rationale30. Design rules and Guidelines31. Golden rules and heuristics32. HCI patterns33. Evaluation techniques and methods34. Task analysis35. Universal design36. User support systems37. Computer Supported Cooperative Work38. Groupware systems39. Implementation of synchronous groupware40. Ubiquitous computing41. History of Computer Graphics42. Graphics architectures and software43. Imaging and vision: Pinhole camera, Human vision, Synthetic camera44. Modeling vs. rendering45. OpenGL Architecture46. Displaying simple two-dimensional geometric objects47. Positioning systems and windowed environment48. Color perception and models49. RGB, CMY, HLS color models50. Color transformations51. Color in OpenGL: RGB and indexed color52. Input: Network environment and client-server computing53. Input measures: event, sample and request input54. Using callbacks and picking55. Affine transformations: translation, rotation, scaling, shear56. Homogeneous coordinates and concatenation57. Current transformation and matrix stacks58. Three Dimensional Graphics: Classical viewing59. Specifying views in 3D60. Affine transformation in 3D61. Projective transformations62. Ray tracing63. Shading: Illumination and surface modeling64. Phong shading model65. Polygon shading66. Rasterization: Line drawing via Bresenham's algorithm67. Clipping and polygonal fill68. BitBlt operations69. Hidden surface removal (z buffer)70. Discrete Techniques: Buffers71. Reading and writing bitmaps and pixel maps72. Texture mapping73. Compositing
    COMP3145›Reading and writing bitmaps and pixel maps
    HCI & Computer GraphicsTopic 71 of 73

    Reading and writing bitmaps and pixel maps

    3 minread
    490words
    Beginnerlevel

    1. Definition

    Bitmaps and pixel maps are digital representations of images where each pixel’s color value is stored in memory.

    • Bitmap (BMP): A simple image format storing pixels in a grid, row by row.
    • Pixel map (pixmap): A general term for any image representation that stores color values for each pixel.

    Reading and writing refers to the process of importing image data into memory and exporting it from memory to storage or display.


    2. Structure of Bitmaps

    2.1 Bitmap Components

    A standard bitmap image consists of:

    1. Header

      • Contains information like image width, height, color depth, and compression.
    2. Color Table (optional)

      • Used in indexed color bitmaps (e.g., 8-bit images).
      • Maps pixel indices to actual RGB color values.
    3. Pixel Data

      • Stores the color information for each pixel.
      • Usually stored row by row (bottom-to-top in BMP files).

    2.2 Pixel Representation

    • Each pixel can be represented in different ways:

      • Monochrome: 1 bit per pixel (black/white)
      • Grayscale: 8 bits per pixel
      • RGB color: 24 bits per pixel (8 bits each for Red, Green, Blue)
      • RGBA: 32 bits per pixel (includes alpha for transparency)

    3. Reading a Bitmap

    To read a bitmap into memory:

    1. Open the file in binary mode.
    2. Read the header to get image dimensions and color depth.
    3. Read the color table (if indexed colors are used).
    4. Read pixel data into a 2D array or pixel buffer.
    5. Optional conversion to internal representation for processing.
    • Example in pseudocode:
    open("image.bmp", "rb")
    read header -> width, height, color depth
    read color table (if exists)
    for each row:
        read pixel data into array
    

    4. Writing a Bitmap

    To write a bitmap from memory:

    1. Create a header with image size, width, height, and color depth.
    2. Write the header to the file.
    3. Write the color table (if indexed).
    4. Write the pixel data from memory row by row.
    • Example in pseudocode:
    open("output.bmp", "wb")
    write header
    write color table (if needed)
    for each row in pixel array:
        write pixel data to file
    

    5. Pixel Maps (Pixmaps)

    • A pixel map is similar to a bitmap but may use other formats like PNG, TIFF, or custom pixel buffers.

    • Reading/Writing pixel maps involves:

      • Loading pixel values into memory
      • Manipulating pixels
      • Saving the modified pixels back to disk or display

    6. Applications

    1. Image editing software (Photoshop, GIMP)
    2. Rendering engines for textures in 2D/3D graphics
    3. Graphics file conversion between formats
    4. Game development for sprites and textures

    7. Summary Table

    Operation Purpose Key Steps
    Reading bitmap Load image into memory Read header → Color table → Pixel data
    Writing bitmap Save image from memory Create header → Write color table → Write pixel data
    Pixel map General image buffer Store/modify pixels for rendering

    Key Points:

    • Bitmaps/pixel maps store pixel-by-pixel color information.
    • Reading involves loading header, color table, and pixels.
    • Writing involves creating a file with proper header and pixel data.
    • They are foundational for 2D graphics, textures, and image processing.
    Previous topic 70
    Discrete Techniques: Buffers
    Next topic 72
    Texture mapping

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count490
      Code examples0
      DifficultyBeginner