Black and White Effect

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Black and White Effect

Post by agriz »

How to do this effect?
Give me some clues.

Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Black and White Effect

Post by fmw42 »

Make a mask of black/white stripes, then blend that with the background image so that you use mostly the striped image. The stripes can be made from a small image that is then tiled out to the size of your background image.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Black and White Effect

Post by Bonzo »

Below is an example from my website I did a few years ago and did know it could be used for this effect. You could experiment with the dissolve and the line thicnesses for the best effect.

Code: Select all

<?php  
// Create a image 2px wide and 4px high. Colour the top 2px wide and 1px high black
 exec("convert -size 2x4 xc:none -fill black -draw \"rectangle 0,0 2,1\" tile.png");
 
// Lay the black and white stripped image over the main image adjusting the opacity to create the desired effect
 exec("composite -dissolve 30% -tile tile.png sunflower.jpg blinds.jpg"); 

// Delete the tempory files 
unlink("tile.png"); 

/* 
An improved method without any tempory images. 
This uses the imagemagick miff:- which saves the image into the memory and then the Unix | "pipe".
 This uses the image created in the first part of the code in the second part of the code.
 */ 

$cmd = "-size 2x4 xc:none -fill black -draw \"rectangle 0,0 2,1\" miff:- | ". 
" composite -dissolve 30% -tile - sunflower.jpg "; 

exec("convert $cmd blinds.jpg"); 
 ?> 
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Black and White Effect

Post by anthony »

create a very small tile image and tile it!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Black and White Effect

Post by agriz »

I did that.
is that good?

Image
Post Reply