Once one "plays with" the two image approach and is comfortable in understanding its operation, it should not be difficult to make the jump to slight restrictions in the image colors. e.g. only even shades so that the least significant bit is not used to convey color, but rather conveys (part of) the mask.
Have any code? I was trying to figure out how you'd go about setting LSB of the original image...
Have any code? I was trying to figure out how you'd go about setting LSB of the original image...
I answered that publically back in Reply #8, (and also sent you detailed information via PM....
Step #1: AND each pixel with 0xFFFEFEFE
Step #2: Convert Hot Spot ID 1-7 into 0X000001, 0X0000100, 0X0000101, 0X010000, 0x010001, 0x010100, 0x010101
Step #3: Or Value with color.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010 In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Maybe I'm missing something. What program would I use for that?
You WRITE one.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010 In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Not quite sure what the hell happened there, Posted it the same way i always do ... however somehow i think something got Fed.. When i check the original zip on my system, it also gave errors..
Heres a new zip .. (tested this time, and it does have everything in it ...) [.NET 2008 (2.0 Framework)]
Just for fun, I wanted to copy each masked area to a new image.
Found some code for fast copying, and adapted.
But I can't copy back the masked images into picturebox. Just stuck in
Code:
Dim ms As MemoryStream = New MemoryStream(Array.ConvertAll(Source, New Converter(Of Int32, Byte)(Function(v As Int32) CByte(v))))
Destiny = Image.FromStream(ms)
Which is something you apparently couldn't do easily, or at all?
I already posted the code. What I typically do is use PhotoShop, reduce the color depth of the original image, add a layer with the appropriate color for each hotsopt then simply merge the image.
But it CAN easile be done in ANY language and used on ANY platform simply by iterating the pixels and performing the steps posted.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010 In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
I already posted the code. What I typically do is use PhotoShop, reduce the color depth of the original image, add a layer with the appropriate color for each hotsopt then simply merge the image.
But it CAN easile be done in ANY language and used on ANY platform simply by iterating the pixels and performing the steps posted.
Technically you haven't posted any code in this thread.
Don't try and take credit for Grem's code, or even his idea since you've already opposed it, as being a two picture solution.
I think you need mental help. I'm putting you on my ignore list.
For those who can not find the original material on stegography and its utilization for hotspots, or have problems with the c++ implementation in the article, here is a (non-optimized) VB.NET
Code:
Public Shared Sub Encode(ByVal src As Bitmap, ByVal mask As Bitmap, ByVal key As List(Of Color))
Dim x As Integer
For x = 0 To src.Width - 1
Dim y As Integer
For y = 0 To src.Height - 1
Dim rgb As Integer = (src.GetPixel(x, y).ToArgb And -65794)
Dim m As Integer = key.IndexOf(mask.GetPixel(x, y))
rgb = (rgb Or HotSpot.t(m))
src.SetPixel(x, y, Color.FromArgb(rgb))
Next y
Next x
End Sub
Public Shared Function HotIndex(ByVal src As Bitmap, ByVal x As Integer, ByVal y As Integer) As Integer
Dim m As Integer = (src.GetPixel(x, y).ToArgb And &H10101)
Dim i As Integer
For i = 0 To 8 - 1
If (HotSpot.t(i) = m) Then
Return i
End If
Next i
Return 0
End Function
Shared Sub New()
HotSpot.t = New Integer() { 0, 1, &H100, &H101, &H10000, &H10001, &H10100, &H10101 }
End Sub
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010 In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Thanks. That makes it crystal clear. I think I was hung up on this line...
No problem...You really have to stop thinking in decimal
You should be able to see how to extend by chaning 010101 to 030303 and getting 31 distinct spots.
Also if the patterns are in a List rather than an array, the explicit for loop can be replated with an IndexOf, and the total amount of code that is needed in the application is a single statement.
Plus the fact that I've never used Photoshop. (artistic skills lacking)
Actually the reason I DO use photoshop is because I am completely non-artistic, but you can create plugins that do all of the work based on a mathematical basis.
As you should now see, the colors for active areas will be VERY VERY close to the colors used for the same visual look, but in non (or different) areas. This does make this approach MUCH more suspectible to any distortion caused by compression and/or stretching. A 0.0000476837158203125% distortion will cause false results.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010 In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Once one "plays with" the two image approach and is comfortable in understanding its operation, it should not be difficult to make the jump to slight restrictions in the image colors. e.g. only even shades so that the least significant bit is not used to convey color, but rather conveys (part of) the mask.
I've played a little with the idea of moving to only a single image using the LSB of each color as the Hotspot masking ...
And here is a list of considerations that i feel do not warent doing so...
1) The Hotspoted Image WILL HAVE TO be stored as a BMP .. Why
JPG's loose compresion wreeks havoc on the LSB's, causing a loss of hotspot info ..
GIF's Indexed color map. Too stay within the max colors the encoder will merge most of the close colors, again causing a loss of LSB's.
Most other image compresion formats also loose LSB data..
2) In the case of stretched images the image will still need to be loaded twice.
First. To the streched/Squeezed picturebox.
Second. To a hidden image sixed picturbox
Because of the unpredictable effect of the stretch code on pixel color's there's a good chance of LSB data loss ...
looking at simple Color averaging .. if we half the image size, and use the avarage of a 2 * 2 pixel block to select the color (looking at only one byte) and our cube has Color codes : 43,45,47,49 ... (LSB set for hotspot) however our new single pixel will have an averaged color code of 46 (LSB NOT SET) changing our hotspot value.
3) Applying Multiple masks to a single image requires a new full image for each set.
Consider the point of an image with multiple levels of focus. Like the one used in my example, if we looking at the foreground, we hotspot only items in the foreground, and ignore the background.. However we could draw up a second mask for it, ignoring the foreground and hot spot each of the seperate fish in the background.
Using a Seperate mask allows multiple masks to be applied to a single image.
These are just a few of the issues that I can foresee in the use of LSB's for hotspoting .. BUT I"M NOT SAYING that you cant use it, it's still worth a try..
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.