Hello, i'm trying to change image background from #FFFFFF to #F2F2F2, without damaging image. I try to make image transparent (delete all background along the counter and then set my new color bg, but it damage pixels). Then i try to replace all white pixels and replace it with needed color, but it also damage image cause visualy all bg white, but somewhere color like more or less darken. I have image with hard counter, there is example of original image http://rghost.ru/51020287.view020287.view.
With photoshop i create second layer with #F2F2F2 background and use "Multiply" effect for my image, and it's work perfect, but how i can do something like this with ImageMagick. If anybody know, help please
There is example like it correctly looks after photoshop http://rghost.ru/51020415.view
I trying to do something like this, dissolve 2 images, by this composite -dissolve 30x70 -gravity South \test.jpg bg.jpg -alpha Set result.jpg but i get this http://rghost.ru/51020432.view
Change white background
Change white background
Last edited by kxc on 2013-12-17T00:45:44-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Change white background
Multiplying by #f2f2f2 will darken all the pixels. You can easily do this with IM. #f2 = 242. 242/255 = 0.949.
Code: Select all
convert test.jpg -evaluate Multiply 0.949 out.png
snibgo's IM pages: im.snibgo.com
Re: Change white background
Wooow... It's very nice, many thanks to you And thank for this very quickly reply.snibgo wrote:Multiplying by #f2f2f2 will darken all the pixels. You can easily do this with IM. #f2 = 242. 242/255 = 0.949.Code: Select all
convert test.jpg -evaluate Multiply 0.949 out.png
Re: Change white background
Sorry, mby somebody know the best way to do this using PHP ?
I make this with following code
But mby there is other way, by using Imagick for PHP ?
I make this with following code
Code: Select all
for ($i = 0; $i < 4; $i++) {
echo "<pre>";
exec("convert ".$i.".jpg -evaluate Multiply 0.949 ".$i."_result.jpg");
echo "</pre>";
}
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Change white background
see http://us3.php.net/manual/en/imagick.evaluateimage.php
but note that Imagick is not very well supported any longer and generally does not speed things up. See
viewtopic.php?f=4&t=16779
but note that Imagick is not very well supported any longer and generally does not speed things up. See
viewtopic.php?f=4&t=16779