
<?php
bool Imagick::newPseudoImage(
int $columns,
int $rows,
string $pseudoString
);
?>
BUILT-IN PATTERNS | |||
| Tag | Mode | Description | Notes |
| BRICKS | R | brick pattern, 16x16 | |
| CHECKERBOARD | R | checkerboard pattern, 30x30 | |
| CIRCLES | R | circles pattern, 16x16 | |
| CROSSHATCH | R | crosshatch pattern, 8x4 | |
| CROSSHATCH30 | R | crosshatch pattern with lines at 30 degrees, 8x4 | |
| CROSSHATCH45 | R | crosshatch pattern with lines at 45 degrees, 8x4 | |
| FISHSCALES | R | fish scales pattern, 16x8 | |
| GRAY0 | R | 0% intensity gray, 32x32 | |
| GRAY5 | R | 5% intensity gray, 32x32 | |
| GRAY10 | R | 10% intensity gray, 32x32 | |
| GRAY15 | R | 15% intensity gray, 32x32 | |
| GRAY20 | R | 20% intensity gray, 32x32 | |
| GRAY25 | R | 25% intensity gray, 32x32 | |
| GRAY30 | R | 30% intensity gray, 32x32 | |
| GRAY35 | R | 35% intensity gray, 32x32 | |
| GRAY40 | R | 40% intensity gray, 32x32 | |
| GRAY45 | R | 45% intensity gray, 32x32 | |
| GRAY50 | R | 50% intensity gray, 32x32 | |
| GRAY55 | R | 55% intensity gray, 32x32 | |
| GRAY60 | R | 60% intensity gray, 32x32 | |
| GRAY65 | R | 65% intensity gray, 32x32 | |
| GRAY70 | R | 70% intensity gray, 32x32 | |
| GRAY75 | R | 75% intensity gray, 32x32 | |
| GRAY80 | R | 80% intensity gray, 32x32 | |
| GRAY85 | R | 85% intensity gray, 32x32 | |
| GRAY90 | R | 90% intensity gray, 32x32 | |
| GRAY95 | R | 95% intensity gray, 32x32 | |
| GRAY100 | R | 100% intensity gray, 32x32 | |
| HEXAGONS | R | hexagon pattern, 30x18 | |
| HORIZONTAL | R | horizontal line pattern, 8x4 | |
| HORIZONTAL2 | R | horizontal line pattern, 8x8 | |
| HORIZONTAL3 | R | horizontal line pattern, 9x9 | |
| HORIZONTALSAW | R | horizontal saw-tooth pattern, 16x8 | |
| HS_BDIAGONAL | R | backward diagonal line pattern (45 degrees slope), 8x8 | |
| HS_CROSS | R | cross line pattern, 8x8 | |
| HS_DIAGCROSS | R | diagonal line cross pattern (45 degrees slope), 8x8 | |
| HS_FDIAGONAL | R | forward diagonal line pattern (45 degrees slope), 8x8 | |
| HS_HORIZONTAL | R | horizontal line pattern, 8x8 | |
| HS_VERTICAL | R | vertical line pattern, 8x8 | |
| LEFT30 | R | forward diagonal pattern (30 degrees slope), 8x4 | |
| LEFT45 | R | forward diagonal line pattern (45 degrees slope), 8x8 | |
| LEFTSHINGLE | R | left shingle pattern, 24x24 | |
| OCTAGONS | R | octagons pattern, 16x16 | |
| RIGHT30 | R | backward diagonal line pattern (30 degrees) 8x4 | |
| RIGHT45 | R | backward diagonal line pattern (30 degrees), 8x8 | |
| RIGHTSHINGLE | R | right shingle pattern, 24x24 | |
| SMALLFISHSCALES | R | small fish scales pattern, 8x8 | |
| VERTICAL | R | vertical line pattern, 8x8 | |
| VERTICAL2 | R | vertical line pattern, 8x8 | |
| VERTICAL3 | R | vertical line pattern, 9x9 | |
| VERTICALBRICKS | R | vertical brick pattern, 16x16 | |
| VERTICALLEFTSHINGLE | R | vertical left shingle pattern, 24x24 | |
| VERTICALRIGHTSHINGLE | R | vertical right shingle pattern, 24x24 | |
| VERTICALSAW | R | vertical saw-tooth pattern, 8x16 | |
| ed48 | |||
EXERCISE
<?php
$arrps = [ "BRICKS", "CHECKERBOARD", "CIRCLES",
"CROSSHATCH", "CROSSHATCH30", "CROSSHATCH45",
"FISHSCALES", "GRAY0", "GRAY5", "GRAY10",
"GRAY15", "GRAY20", "GRAY25", "GRAY30", "GRAY35",
"GRAY40","GRAY45", "GRAY50", "GRAY55", "GRAY60",
"GRAY65", "GRAY70", "GRAY75", "GRAY80", "GRAY85",
"GRAY90", "GRAY95", "GRAY100", "HEXAGONS",
"HORIZONTAL", "HORIZONTAL2", "HORIZONTAL3",
"HORIZONTALSAW", "HS_BDIAGONAL", "HS_CROSS",
"HS_DIAGCROSS", "HS_FDIAGONAL", "HS_HORIZONTAL",
"HS_VERTICAL", "LEFT30","LEFT45", "LEFTSHINGLE",
"OCTAGONS", "RIGHT30", "RIGHT45", "RIGHTSHINGLE",
"SMALLFISHSCALES", "VERTICAL", "VERTICAL2",
"VERTICAL3", "VERTICALBRICKS", "VERTICALLEFTSHINGLE",
"VERTICALRIGHTSHINGLE", "VERTICALSAW" ];
$str1img = 'img/results/8new.png';
$im = new Imagick();
// Run this exercise several times
$p = mt_rand(0, count($arrps) -1);
{
$im->newPseudoImage(300, 50, "pattern:$arrps[$p]");
}
$im->setformat('png');
$data = $im->getImageBlob();
$im = imagecreatefromstring($data);
imagepng($im, $str1img);
?>
<img src="<?php echo $str1img; ?>"
alt="<?php echo $str1img; ?>"
title="<?php echo $str1img; ?>">
