PHP generated web page hidden image

zhaozj2021-02-16  52

Everyone has seen web hidden images, which can generally be hidden with Firework or PS. Here are the principles. When we choose Ctrl a, there is a change in the image, all X and Y coordinates and pixels that can be completely removed (called A-class pixels) will be retained, while all X and Y coordinates and cannot The pixels (aunt, known as B-class pixels) are covered by blue pixels, causing a translucent mask. Such as pixels (0, 0) can be reserved and pixels (1, 0) are covered with blue pixels with blue pixels. Imagine, we will start with all A class pixels, such as (0, 0)), cover out (for example, white) with other colors, then the Blass C is left (eg (1,0)) Half of information, because of the reason for the resolution, we can still see the outline of this pair, just feel a layer of translucent mask. When we choose, Windows uses all B class pixels to cover the blue pixels, then we can only see A class pixels, but Class A pixel valid information has been covered with white pixels. The macro effect is that we can't see a valid picture pixel.

But if we don't cover the A class pixels, it is replaced by another picture (we become a picture 2, the original picture is called a picture 1) A class pixel. Then we see the effect of two pictures mixed, in this picture, the A class pixels take pictures 2 information, and B-class pixels take pictures 1 information. When we choose, B-class pixels are covered by Windows with blue pixels, we can only see A class pixels, the rest is the information of the picture 1.

It is still not perfect here, it is a picture 2 hidden, what should I do? Since the picture 2's Class A pixel is necessary to keep it, the picture 1's B-class pixel must keep, then we put the picture 2 Transparency is increased, so that the picture 2 is diminished, it may reduce people's attention to it:

The effect is still not good, still see it. What to do, we join the interference factor, it is the habit of the picture color to break the human eye. Let's take a separate picture 2 experiment. Image 2's Class A pixel must be retained, then we can turn the B-class pixels of the picture 2 into a negative effect, so that mixing will get unconventional effect, because this contour does not meet the human habits, it will interfere with the human eye Normal identification. This effect is out.

Then we raise the picture 2 transparency, mixed in the picture 1, when selecting, the picture 1 of the picture 1 is blocked, mixed pictures of the A-class pixels and pictures 1 of the picture 1 pixel position White pixels are translucent, we can see the information of the picture 2, when there is no selection, the negative pieces of the B-class pixel included in the picture 2 of the picture 2 and the front information of the picture 1, due to A B-class pixels are mixed by the same intensity, so the B-class pixels in the mixed picture will still interfere with the A-class pixels unless the all-in-one pixel is shielded.

While (List ($ KEY, $ VAL) = Each ($ _ get)) {$ Param [$ key] = $ val;}

$ SIZE = GetImagesize ($ param ['bgimg']); $ size1 = getimagesize ($ param ['hdimg']); if ($ size [0])> 400 || ($ SIZE [1]> 300) ) {Echo 'Too Large Images, Less Than 400 * 300 Pixels.'; Exit;} IF ($ size1 [0])> 400 || ($ size1 [1]> 300)) {Echo 'Too Large Images, Less Than 400 * 300 Pixels. '; exit;} $ = imagecreatefromjpeg ($ Param [' bgimg ']); $ IM1 = ImageCreateFromJPEG ($ Param [' HDIMG ']);

Define ($ IMAGECOLORALLOCATE ($ IM, 255, 255, 255); Define (Black, ImageColoralLocate); Define (Fill_Color, ($ Param ['fmode'] == 'Black')? Black "? : white); Define (IMGH, ImageSY); Define (IMGW, ImageSx ($ IM));

For ($ y = 0; $ y <= IMGH; $ y ) for ($ x = 0; $ x <= IMGW; $ x ) {IF (($ x $ y)% 2)) {imagesetpixel ($ iSetpixel ImageColoRat ($ IM1, $ x, $ y); imagesetpixel ($ IM, $ x, $ y, fill_color);} else {ImagSetPixel ($ IM1, $ X, $ Y, WHITE -ImageColorat ($ IM1, $ X, $ Y); ImageEsetPixel ($ IM, $ X, $ Y, ImageColorat ($ IM, $ x, $ y);}}

ImageCopyMerge ($ IM, $ IM1, 0, 0, 0, 0, IMGW, IMGH, $ Param ['alpha']); // Mixed image, do Alpha mix

Header ("Content-Type: Image / PNG"); ImagePng ($ IM); ImageDestroy ($ IM); ImageDestroy ($ IM1);}?>

转载请注明原文地址:https://www.9cbs.com/read-20119.html

New Post(0)