I'm working with a function taken from Corrupt (a web based piece of software used to get "glitchy" effects using jpeg images). This function can be found in the corrupt.php file on line 23. At the moment it's not making the files glitchy enough. I made this images to show you how I want the images to look. This was made by opening the jpeg in a text editor and cutting certain lines and pasting them in other places.
I want this function to do a similar thing but at the moment it doesn't. Any ideas? Is there a better way of doing this maybe?
function scramble($content, $size) {
$sStart = 10;
$sEnd = $size-1;
$nReplacements = rand(1, 30);
for($i = 0; $i < $nReplacements; $i++) {
$PosA = rand($sStart, $sEnd);
$PosB = rand($sStart, $sEnd);
$tmp = $content[$PosA];
$content[$PosA] = $content[$PosB];
$content[$PosB] = $tmp;
}
return($content);
}