I'm trying to do something a little like steganography - that is, I want to embed an image in an image so that when it's reduced to 50% size, the embedded image disappears and it becomes a plain color.

This is my attempt.

This is using Linear Dodge (Add) and Subtract blend modes in Photoshop, along with the respective layers being masked to alternating pixel columns.

When reduced to 50%, using bilinear or bicubic resampling, I'd like it to become just a plain color. Instead, it's becoming this:

enter image description here

Why? The resultant colors of the Add and Subtract aren't getting capped at 0 or 255. But, as we can see, lighter parts of the image are losing their red saturation.

How can I manipulate the images - ideally using Photoshop - to get the desired result?

My PSD is here, and the image I used is here.


This is my second attempt:

And that exact same image, resized by your browser:

At least on mine, the A has disappeared. That is what I want, and I want Photoshop to calculate pixel colours rather than me have to do it manually.

  • Scott has a great answer, but a quick comment: It appears you are assuming that resizing by 50% removes every other pixel, but that's not how resizing works with interpolation. It uses various formulas to re-calculate every pixel based on its neighboring pixels.
    – DA01
    Jun 23, 2013 at 21:30
  • @DA01 Thanks for the response. I think you made the same mistake Scott did – zoom in on my attempt and you'll see it's composed of lighter and darker columns of pixels. The theory, which is correct, is that bilinear and bicubic resampling will average the pixels in the dark and the light columns to result in a pure red column. This can be seen by resizing by 50% this image using bilinear or bicubic resampling.
    – Max
    Jun 24, 2013 at 2:43
  • ah, that is a bit different. That said, I can't get the sample 'A' image to disappear at 50% in the software I have at hand (Chrome and Pixelmator). I have a hunch that getting this to work requires an understanding of the very specific resampling algorithm the particular software is using...which isn't necessarily the same as what other software may be using.
    – DA01
    Jun 24, 2013 at 3:50
  • Do you really want to understand the signal theory of this? I mean a good downsampling filter, would be able to keep the image intact as per Nyquist Shannon sampling theorem. The theorem predicts that a filter can see your demo letter a up until about 1/10th of the size. The striping inside will become noise or blend in tough. The problem here is that there are several downsampling filters that can probably defeat your purpose. Seems that your otherwise doing well except you dont account for Photoshop being gamma aware.
    – joojaa
    Feb 24, 2014 at 7:44
  • Oh and btw. my browser sees the entire A in the scaled image. Anyway there are many ways to downsample and hand crafting would only work against one such filter. So you would still loose if they use some other downsampling method than you.
    – joojaa
    Feb 24, 2014 at 7:49

1 Answer 1


I don't think what you are trying to do is possible due to interpolation. But it depends somewhat on the intended use of the image and why you would want to do this.

Almost all raster applications will attempt to retain contrasting pixels upon resizing, some better than others. But I've never seen any raster image simply remove a section which covers more than 3 or 4 pixels of the entire image. Even then apps tend to retain 1 pixel if the contrast is high enough.

Realize that pixels, in general, are square and not vertical lines. Your masking is similar to that of a lenticular - you know those 3D prints where one way it looks like photo A and the other way it looks like photo B. The reason those work is due to the vertical prism covering and a very precise set of image slices underneath.

This is why I think it's impossible when using pixels. The only possible method may be to surround every image pixel with 6 solid color pixels in the hopes that upon reduction interpolation would see the image pixel as unnecessary and remove it. But again, that is unlikely because most apps are inherently coded to try and retain contrasting pixels.

Realize your blending modes don't really effect the image in any way once you save it. They only work in Photoshop to alter the appearance. You can achieve the same tonal value in much simpler ways, such as merely reducing opacity of a white pixel.

This image is solid red with a few 30% white pixels in the middle. The white pixels are spaced to allow 6 red pixels around each of them. This equates to 2 red pixels between each white pixel.


Clearly they are visible.

Upon a 50% reduction:


You can see they are still visible.

Reducing original white pixels down to a 20% opacity makes them difficult to see before reduction.

20 percent

And after reduction:

20 reduction

They are almost equally visible.

When you increase the amount of white pixels (Still at 20% opacity):


The original gets easier to see and upon reduction it's still there.

20 red

Clearly none of this is making the pixels vanish. So it would take some trial and error to discover the distance between and opacity of a group of contrasting pixels before interpolation makes them vanish. That would be the sweet spot.

In the image below the white pixels are set to 30% opacity. Each white pixels is 8 pixels away from any other white pixel.

8 pixels

Upon a 50% reduction:

8 reduction

You have to look really hard to see the white pixels (but they still haven't vanished). This may work depending on the size of the image. But clearly the further away the contrasting pixels are from each other the better the result.

Taking the larger image above, opening that image in a browser, and using the browser to reduce the image, will effectively make the white pixels vanish. So, if you're looking for a solution for a browser, this may actually work. And in fact, placing the larger image in an html page at it's original size of 500x500pixels and then using html to set the image size to 250x250pixels, seems to remove the white pixels as well. See a demo of this here

So let's test with the portrait. I created a grid of pixels space 8 pixels apart and used that to mask the face over the red background:


Pixels are so far apart the message of the image gets lost.

Reducing to 50% via Photoshop, doesn't really do anything other than make it all smaller:


Dropping the full size image onto a browser window and reducing in the browser via Command/Ctrl-minus down to 50% obscures the face a bit more. However something is still clearly there. (This is a screenshot of the browser window)


And reducing one more step in a browser window down to 33% seems to hide the white pixels for the most part. if you scrutinize the image, you can still detect some white pixels, but it's unlikely most viewers would look for them. (This is a also screenshot of the browser window):


So..... the problem becomes how far apart can you make pixels and still convey an image? And, how much time are you willing to dedicate to separating individual pixels to create that image?

  • Thanks for your very detailed answer Scott. However, there's a part of my attempt that I think you may be overlooking. I'm combining columns of pixels that are alternately lighter and darker than the red color. So I'm not trying to make pixels disappear – I'm trying to make pixels average out to the red color. This is of course theoretically perfectly possible with nearest neighbour resampling, and I believe it's near perfectly possible with bilinear/bicubic resampling.
    – Max
    Jun 24, 2013 at 0:42
  • The question is: how to make photoshop generate the lighter and darker columns so that when the pixels are averaged, it'll result in a constant red color.
    – Max
    Jun 24, 2013 at 0:43
  • Actually Alec, that, to me, sounds exactly like you are trying to make pixels disappear. "average out to the solid color" is merely another way of stating "disappear". And everything I've posted is accurate even after your comment. The apps are inherently designed to retain contrasting pixels. Nearest Neighbor will do more to retain contrast than average it to even. It's just not going to happen. I'd love to be proved wrong though.
    – Scott
    Jun 24, 2013 at 1:21
  • And... "the embedded image disappears and it becomes a plain color." You may want to double-check the question if that's not what you meant. :)
    – Scott
    Jun 24, 2013 at 1:32
  • "It's just not going to happen." See this image. Resizing to 50% using bilinear resampling results in a perfectly red square, using bicubic results in a red square with some slight shadowing at the edges of the 'A'. This is exactly the result that I want, but I'd like to be able to do it in Photoshop without having to calculate the color of each pixel manually.
    – Max
    Jun 24, 2013 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.