Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Channel pixel order #30

Open
roipoussiere opened this issue Dec 17, 2021 · 4 comments
Open

add Channel pixel order #30

roipoussiere opened this issue Dec 17, 2021 · 4 comments

Comments

@roipoussiere
Copy link

roipoussiere commented Dec 17, 2021

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.

@Ge0rg3
Copy link
Owner

Ge0rg3 commented Jan 28, 2022

Hi! Thank you for your suggestion. This would definitely be an interesting feature, and I would love to include this in the next release. However, it seems a bit tricky from a UI standpoint -- any ideas on this?

@roipoussiere
Copy link
Author

I was thinking about a third option in the Pixel Ordel list, which could then be renamed differently, like "byte ordering", or "iterate over...".

@Ge0rg3
Copy link
Owner

Ge0rg3 commented Mar 5, 2022

Hi, on further thought, isn't this already implemented via the following config?
image

EDIT: The inverse should be selected ^

@roipoussiere
Copy link
Author

No, this produces an image with altered pixels on top of the image. What I suggest is to distribute altered pixels on the whole image.

On my test scenario, 7 on 8 bits must be altered in order to encode the whole data in the image (this way we can clearly see the difference in the image).

So, with pixel order = row, bit order = MSB, bit plane order = rgb, pad remaining bits = no, and these options:
⬜ ⬜ ⬜
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
produce this:
image

And these options:
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
☑️ ☑️ ☑️
⬜ ⬜ ⬜
produce this:
image

Here are my test data:

input: Le Désespéré, Gustave Courbet
Le_Désespéré

image file to encode: The Starry Night, Vincent van Gogh
The Starry Night

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants