Page 1 of 1

[Solved] How to color fill part of an image?

Posted: Wed Nov 09, 2022 11:14 pm
by fretlessman71
Seems like this should be easy.... I have an image of a football team uniform, and I want to experiment with different color schemes. I'd love to be able to click on a part of the image (graphics, not an actual photo), have OpenOffice recognize the area of that particular color, and choose a new color. Is this possible? How? Is there an existing tutorial for this task?

Re: How to color fill part of an image?

Posted: Thu Nov 10, 2022 12:19 am
by Hagar Delest
Hi and welcome to the forum!

It depends on how the shapes have been made.
Can you upload a sample file? If more than 128KiB, then use a 3rd party file sharing web site.

Re: How to color fill part of an image?

Posted: Thu Nov 10, 2022 1:15 am
by fretlessman71
I used the Apple screen capture method to get this file from a Wiki page. I squashed it down to load up here.

I want to make the pants orange.

What is the easiest way to do this?

Re: How to color fill part of an image?

Posted: Thu Nov 10, 2022 6:49 am
by Zizi64
Your sample is a pixelgraphic image. You need use a third party pixelgraphic editor for this task. The pixelgraphic images are stored as millions of colorized dots (pixels).

(There are free pixel graphic editors like the Gimp. These softwares can substituted a bunch of pixels that have same color to other color pixels.)


The AOO/LO are vectorgraphic editors. The vectorgraphic images are stored as matematically descripted lines and areas diveded by the lines.
You can colorize/re-colorize the parts (the areas divided by mathematically descripted lines) of a vectorgraphic image in the AOO / LO.

Re: How to color fill part of an image?

Posted: Thu Nov 10, 2022 9:24 am
by Hagar Delest
The screenshot is png but maybe the source file is .svg.
If the source file is a raster one (.png/.jpg/...), then as said by Tibor above, you need The Gimp for example and use the paint can to apply colors based on the color picked up for replacement (just click a white area to fill in all contiguous areas of white).
If the source file is svg, then with Inkscape for example you can select the various shapes and easily modify their parameters (background and contour line colors).

Re: How to color fill part of an image?

Posted: Thu Nov 10, 2022 3:55 pm
by Zizi64
Here is a sample file.
I just try to show you how you can edit the vectorgraphic images in the AOO/LO Draw application.

The .svg image was downloaded from:
https://www.svgrepo.com/svg/77510/football

After importing the image into a new LibreOffice Draw document, I just made a copy of the image. Then I have converted the copied one to Polygon. You can select the small (partial) poligons by double click on the copied ball. (The cursor goes into the group, then you can select the inner polygons one-by-one.)
I just recolorized the polygons by two user defined object Styles named Yellow and Purple.

Double click on the empty area of the Page (near to an edge) to leave the group.
Edit Vectorgraphic image.odg
(46.55 KiB) Downloaded 319 times

Re: How to color fill part of an image?

Posted: Thu Nov 10, 2022 8:32 pm
by John_Ha
In Draw, create, say, a rectangle and send it to the back. Now cover it with other shapes in front of it to create a shirt shape. Now change the colour of the rectangle by right-click > Area ..., and choose your colour.

Easily done with IrfanView and its Paint add-on. Just select the colour and use the paint tin to fill the area. You may need to set a tolerance if the colour you are replacing is not constant. You may need to draw a thin line as a border to the area or the colour may spill outside the area you want.

Or set the shirt to Transparent in a .PNG file. Place the image onto various colour backgrounds.

Re: How to color fill part of an image?

Posted: Thu Nov 10, 2022 9:22 pm
by John_Ha
This took a few seconds with IrfanView. I didn't bother to tidy up the thin white border around the colour.

1. Image > Tile ... to create 3 suits. (Edit > Replace colour ..., to replace the grey squares with white)
2, F12 to open Paint
3. Choose the colour
4. Set the tolerance to, say, 10
5. Use the paint can to pour paint into the area as required.