Skip to content

add Channel pixel order #30

@njourdane

Description

@njourdane

Let's assume that we want to encode 24 bits of data in a 2x2 image.

For now, 2 options are available in the Pixel Ordel list:

Column

Altered bits (using a fictive 4 bits per channel image format, for readability):

  r   g   b      r   g   b
╔═══╦═══╦═══╗  ╔═══╦═══╦═══╗
║ X ║ X ║ X ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║   ║   ║   ║
╚═══╩═══╩═══╝  ╚═══╩═══╩═══╝
╔═══╦═══╦═══╗  ╔═══╦═══╦═══╗
║ X ║ X ║ X ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║   ║   ║   ║
╚═══╩═══╩═══╝  ╚═══╩═══╩═══╝

Result on an actual image (200x163 image, 73kb of data):
image

Row

Altered bits:

  r   g   b      r   g   b
╔═══╦═══╦═══╗  ╔═══╦═══╦═══╗
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╚═══╩═══╩═══╝  ╚═══╩═══╩═══╝
╔═══╦═══╦═══╗  ╔═══╦═══╦═══╗
║   ║   ║   ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║   ║   ║   ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║   ║   ║   ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║   ║   ║   ║  ║   ║   ║   ║
╚═══╩═══╩═══╝  ╚═══╩═══╩═══╝

Result:
image

Channel

And here is my proposal: iterating over channels instead rows or columns:

Altered bits:

  r   g   b      r   g   b
╔═══╦═══╦═══╗  ╔═══╦═══╦═══╗
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║   ║   ║   ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║   ║   ║   ║  ║   ║   ║   ║
╚═══╩═══╩═══╝  ╚═══╩═══╩═══╝
╔═══╦═══╦═══╗  ╔═══╦═══╦═══╗
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║ X ║ X ║ X ║  ║ X ║ X ║ X ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║   ║   ║   ║  ║   ║   ║   ║
╠═══╬═══╬═══╣  ╠═══╬═══╬═══╣
║   ║   ║   ║  ║   ║   ║   ║
╚═══╩═══╩═══╝  ╚═══╩═══╩═══╝

Result:
image

This is an interesting feature as it better hides the data in the image (since it avoids to visually see the difference between untouched an altered areas), and improve global image quality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions