StegOnline icon indicating copy to clipboard operation
StegOnline copied to clipboard

add Channel pixel order

Open roipoussiere opened this issue 2 years ago • 4 comments

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.

roipoussiere avatar Dec 17 '21 10:12 roipoussiere

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?

Ge0rg3 avatar Jan 28 '22 14:01 Ge0rg3

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

roipoussiere avatar Feb 13 '22 01:02 roipoussiere

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

EDIT: The inverse should be selected ^

Ge0rg3 avatar Mar 05 '22 14:03 Ge0rg3

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

roipoussiere avatar Mar 23 '22 13:03 roipoussiere