Cant change background image completely

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
soulilya
Posts: 5
Joined: Sun Apr 27, 2014 9:34 pm

Cant change background image completely

Post 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
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Cant change background image complitly

Post 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?
soulilya
Posts: 5
Joined: Sun Apr 27, 2014 9:34 pm

Re: Cant change background image complitly

Post 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
cday
XnThusiast
Posts: 4396
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Cant change background image complitly

Post 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 4255 times
After.png
After.png (139.88 KiB) Viewed 4255 times
Just joking! :D

[Colours inverted, black --> white with some collateral damage.]
soulilya
Posts: 5
Joined: Sun Apr 27, 2014 9:34 pm

Re: Cant change background image complitly

Post by soulilya »

If i add transparancy?
cday
XnThusiast
Posts: 4396
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Cant change background image complitly

Post 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! :)
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Cant change background image complitly

Post 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 4245 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:
soulilya
Posts: 5
Joined: Sun Apr 27, 2014 9:34 pm

Re: Cant change background image complitly

Post by soulilya »

Thank you guys. And i can use this plug in for packet 1600 pics?
cday
XnThusiast
Posts: 4396
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Cant change background image complitly

Post 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. :(
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Cant change background image complitly

Post 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.
soulilya
Posts: 5
Joined: Sun Apr 27, 2014 9:34 pm

Re: Cant change background image complitly

Post by soulilya »

Thank you. I will try....
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Cant change background image complitly

Post 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 4195 times
cday
XnThusiast
Posts: 4396
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Cant change background image complitly

Post by cday »

soulilya wrote:Thank you. I will try....
Batch operations possible if you have Photoshop and the same settings will work generally...
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Cant change background image complitly

Post by XnTriq »

cday wrote:Batch operations possible if you have Photoshop and the same settings will work generally...
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Cant change background image complitly

Post by XnTriq »

</incessantflagellationofdeceasedequine>
Post Reply