Re: Image background

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Image background
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tcl
Date : 17. Oct 2024, 20:56:51
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <verq62$2spna$1@dont-email.me>
References : 1 2 3
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
saito <saitology9@gmail.com> wrote:
On 10/17/2024 3:35 PM, Rich wrote:
saito <saitology9@gmail.com> wrote:
I wonder if it is possible to remove the background from an image and
make it transparent using Tk or a package? Then I can save it as a png
image. The background in my case consists of a single color. Perhaps I
could replace that color with an "alpha" color but how?
 
man n photo:
 
    imageName transparency subcommand ?arg arg ...?
       Allows examination and manipulation of the transparency
       information in the photo image.  Several subcommands are
       available:
 
 
Thank you - I missed this page.  Does this command apply to non-png
images?

It applies to all Tk photo images.

Whether you can save the transparency to a file will depend upon the
file format you choose to save the result into.

Initially the image will have no transparency, since the
background is a solid, opaque color?

That depends upon what you initially load into the Tk photo.  If you
load a file that can store transparency, and if Tk's image load routine
can load the transparency, you'll get whatever transparency is already
present.

The challenge in my case is I don't know where the background starts and
what color it would be. The latter can be solved by involving the user
perhaps.

One option is to presume that the most common color is likely the
background, but that assumes flat, single color, backgrounds.

If by 'background' you mean something like a building behind people
posing for a photo, then you are getting very deep into advanced image
processing and/or AI image recognition to "find" the background in any
automated way.

Date Sujet#  Auteur
17 Oct 24 * Image background8saito
17 Oct 24 +* Re: Image background5Rich
17 Oct 24 i+* Re: Image background3saito
17 Oct 24 ii`* Re: Image background2Rich
17 Oct 24 ii `- Re: Image background1saito
17 Oct 24 i`- Re: Image background1saito
17 Oct 24 `* Re: Image background2Paul Obermeier
17 Oct 24  `- Re: Image background1saito

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal