Page 1 of 1

Cant change background image completely

Posted: Sun Apr 27, 2014 9:45 pm
by soulilya
Hi guys. Im trying change background image from black to white. Its for my internet magazine. Images over 1300 in jpg format. But when i try change background over main image background stays the same.

For example: http://rghost.ru/54687939

Re: Cant change background image complitly

Posted: Mon Apr 28, 2014 3:45 am
by XnTriq
This is not such a trivial task as it may seem (because of the compression artifacts etc.). Could you post the original/source image?

Re: Cant change background image complitly

Posted: Mon Apr 28, 2014 5:33 pm
by soulilya
XnTriq wrote:This is not such a trivial task as it may seem (compression artifacts). Could you post the original/source image?
Thank you for your reply. This is original image

http://rghost.ru/54710788

Re: Cant change background image complitly

Posted: Mon Apr 28, 2014 6:11 pm
by cday
Not so easy because your image doesn't have transparency...

Could you live with different colours?
Before.jpg
Before.jpg (137.58 KiB) Viewed 4244 times
After.png
After.png (139.88 KiB) Viewed 4244 times
Just joking! :D

[Colours inverted, black --> white with some collateral damage.]

Re: Cant change background image complitly

Posted: Mon Apr 28, 2014 6:40 pm
by soulilya
If i add transparancy?

Re: Cant change background image complitly

Posted: Mon Apr 28, 2014 7:20 pm
by cday
soulilya wrote:If i add transparancy?
I'm sorry but I'm not sure, I have very limited experience with transparency, but I noted that your image was 24-bit...

I've tried converting both the Before and After images to 32-bit, but in each case the foreground becomes the alpha channel rather than the background; I thought there might be a way of separating the image into foreground and background and then inverting the colours in the foreground again to restore the original colours, but if there is I haven't found it.

I also tried replacing black by white in the Before image (using another program) but the lamp outline is to an extent defined by the black background so that didn't work very well. But the outline of the After image seems quite sharp...

This is probably a problem for one of the outline tracing methods in XnTriq's links above, but it would be satisfying to find a direct method.

Possibly a challenge for the night shift! :)

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 12:30 am
by XnTriq
  1. Download and install Mehdi's Eraser Classic plug-in.
  2. Open 008A_1T_YA_b.jpg in XnView.
  3. Convert the image to RGBA (Image » 32 bits).
  4. Go to Filter » Adobe Photoshop Plug-In... and start Mehdi » Eraser Classic.
  5. Set the color to pure black (R0/G0/B0) and Tolerance to 20.
Here's the result I was able to achieve…
p119146_2.png
p119146_2.png (165.49 KiB) Viewed 4234 times
… with these settings:
p119146_1.png
As you can see, it's not perfect, and you cannot use Photoshop-compatible plug-in filters (*.8bf) in batch conversion.
cday wrote:Possibly a challenge for the night shift! :)
:wink: :mrgreen:

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 6:36 am
by soulilya
Thank you guys. And i can use this plug in for packet 1600 pics?

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 6:56 am
by cday
XnTriq wrote: ... and you cannot use Photoshop-compatible plug-in filters (*.8bf) in batch conversion.
soulilya wrote:And i can use this plug in for packet 1600 pics?
I'm afraid not, as Mehdi » Eraser Classic is a Photoshop-compatible (*.8bf) plug-in filter...

So not with XnView software, unless someone can find another way that doesn't require a *.8bf filter. :(

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 3:00 pm
by XnTriq
Even if XnView was capable of including Photoshop filters in batch processing, images with different backgrounds would require different settings/parameters for color and tolerance.
The Plugin Site (Plugin Essentials » [url=http://www.thepluginsite.com/knowhow/tutorials/introduction/introduction.htm#17]Batch Processing with Plugins[/url]) wrote:Several applications let you use plugins for batch processing images. In Photoshop, for example, you need to create an action with the plugin(s) at first. After that you need to go to File > Automate > Batch and choose the previously recorded action. This allows you to process an whole folder of images with the action. It works very similar in Paint Shop Pro (Version 8 and higher). You need to record a script, which includes the plugin, at first. Then you can use the File > Batch > Process command. Another sophisticated application for batch processing images with plugins is Debabelizer Pro. Plugin Commander Pro also lets you batch process images, but in the current version, you can only use FilterFactory plugins for that purpose.

During batch processing there is no plugin dialog displayed and instead the plugin is immediately applied with the recorded parameters. Some plugin, however, don't support scripting and display the dialog for each image, which forces the user to hit OK for every image. Usually FilterFactory, FilterFormula and FilterMeister plugins react that way.

To avoid that in the case of FilterFactory plugins, you can use Plugin Commander Pro to convert them to plugins that apply their effect without displaying a dialog or you can use Plugin Commander Pro for batch processing. Otherwise it may help to hold down the Enter key (or place the top left corner of a heavy book on the Enter key) until all images are processed.

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 8:26 pm
by soulilya
Thank you. I will try....

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 9:45 pm
by XnTriq
At the risk of beating a dead horse, …
p119160_1.png
… this is what's possible with the Extract tool in Photoshop v6.0.1:
p119160_2.png
p119160_2.png (164.62 KiB) Viewed 4184 times

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 10:04 pm
by cday
soulilya wrote:Thank you. I will try....
Batch operations possible if you have Photoshop and the same settings will work generally...

Re: Cant change background image complitly

Posted: Tue Apr 29, 2014 11:45 pm
by XnTriq
cday wrote:Batch operations possible if you have Photoshop and the same settings will work generally...

Re: Cant change background image complitly

Posted: Wed Apr 30, 2014 2:15 am
by XnTriq
</incessantflagellationofdeceasedequine>