• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Verstecken eines Bildes hinter einem transparentem GIF-Bild als Kopierschutz

Hab da vor Jahren mal aus Spaß ein bisschen rumgespielt. Ist praktisch kaum zu nutzen, weil bei großen Bildern auch moderne Browser in die Knie gezwungen werden, aber das Prinzip finde ich lustig.

php:
Code:
$imgsource = 'Pfad_zum_Bild';

$size = @getimagesize($imgsource);

$oldWidth = $size[0];
$oldHeight = $size[1];
$imgType = $size[2];

switch ($imgType) {
    case 1:
        $oldImage = imagecreatefromgif($imgsource);
        break;
    case 2:
        $oldImage = imagecreatefromjpeg($imgsource);
        break;
    case 3:
        $oldImage = imagecreatefrompng($imgsource);
        break;
    default:
        return false;
}


$content  = '<div id="imagecontainer" style="width: '.$oldWidth.'px; height:'.$oldHeight.'px;">';
for($y=0;$y<$oldHeight;++$y){
    for($x=0;$x<$oldWidth;++$x){
        $pixel = imagecolorsforindex($oldImage, imagecolorat($oldImage,$x, $y));
        $content .='<p style="background:rgba('.$pixel['red'].','.$pixel['green'].','.$pixel['blue'].','.(1-(floor(($pixel['alpha']/127)*100)/100)).');top:'.$y.'px;left:'.$x.'px"></p>';
    }
}
$content .= "</div>";
echo '<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <style>
         #imagecontainer p {
            width: 1px;
            height: 1px;
            margin: 0;
            position: absolute;
        }
        #imagecontainer {
            position: relative;
        }
    </style>
</head>
<body>
'.$content.'
</body>
</html>';

Diese Bilder kann man nur noch per Screenshot speichern.^^
 
Werbung:
Zurück
Oben