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

Discuss the drawing application
Post Reply
fretlessman71
Posts: 2
Joined: Sun Aug 28, 2022 8:46 pm

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

Post 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?
Last edited by MrProgrammer on Sat Jun 03, 2023 4:47 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 4.1.13 on MacOS 12.5.1
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to color fill part of an image?

Post 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.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
fretlessman71
Posts: 2
Joined: Sun Aug 28, 2022 8:46 pm

Re: How to color fill part of an image?

Post 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?
Attachments
Screen Shot 2022-11-09 at 12.52.39 PM.png
Screen Shot 2022-11-09 at 12.52.39 PM.png (108.33 KiB) Viewed 4042 times
OpenOffice 4.1.13 on MacOS 12.5.1
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to color fill part of an image?

Post 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.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to color fill part of an image?

Post 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).
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to color fill part of an image?

Post 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 206 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to color fill part of an image?

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to color fill part of an image?

Post 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.
Attachments
shirt.gif
shirt.gif (62.72 KiB) Viewed 3977 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Post Reply