Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: greg Newsgroups: comp.lang.tcl Subject: Re: is there an image package that doesn't require Tk ? Date: Sat, 29 Jun 2024 09:35:26 +0200 Organization: A noiseless patient Spider Lines: 90 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 29 Jun 2024 09:35:27 +0200 (CEST) Injection-Info: dont-email.me; posting-host="63e6fd9076d16e5aec56e6c71bd8df26"; logging-data="4025149"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186K/F7Svg6OiT8KliUjAjsdbhCmHHtRrs=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:3QPdRT2vZawqLSW5jnEUx9xsvmw= Content-Language: de-DE In-Reply-To: Bytes: 3894 Am 29.06.24 um 00:07 schrieb Andreas Leitgeb: > Andreas Leitgeb wrote: >> I'd like it to open a .png file (screenshot from an android >> phone) extract five rectangular regions from it, and convert >> them to something similar to Tk's [$image data] - e.g. a list >> of lists of colors > > Thanks to all who answered... > > Unfortunately, I haven't yet succeeded with any of the suggestions. > > That's where I got stuck with each: > > Gerald Lester: > http://www.graphicsmagick.org/TclMagick/doc/TclMagick.html > Ted Nolan: > https://wiki.tcl-lang.org/page/TclMagick > > I got it to configure it > (--with-magick=/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.11/bin-q16/MagickWand-config) > compile and install "apparently" successfully, but "package require TclMagick" > spews out: > couldn't load file "/usr/local/lib/TclMagick0.45/libTclMagick.so": > /usr/local/lib/TclMagick0.45/libTclMagick.so: undefined symbol: > tclStubsPtr > > > Harald Oehlmann: > https://core.tcl-lang.org/akupries/crimp/home > > I eventually got critcl (from Ubuntu apt) and kettle (from fossil) > installed. If I try to install crimp, it fails at: > install-doc-markdown: no files matched glob pattern "*" > while executing > "glob -directory $src *" > I only find the keyword "install-doc-markdown" in kettle's source > tree, but don't grok it how to just skip that part. Unfortunately, > the docs are the first thing installed, so as it fails there, nothing > else gets installed. > > > greg: > https://wiki.tcl-lang.org/page/Pixane > > Thanks for suggesting, but without source - I'll rather not use it. > > greg: > https://github.com/ray2501/tcl-stbimage > > Seems more targetted towards converting images between formats > and resizing. According to the web page it doesn't seem like > supporting extracting rectangular regions from a bigger image > or any simple access to pixels or rectangles of pixels. > > > Paul Obermeier: > https://github.com/flightaware/tcl.gd > > Extracting rectangles seems covered by "copy", but I didn't > see (in the docs) any sub command to extract an image's data > as "list of list of color" - I could query single pixels, > and I could get it in binary gd/gd2 format, but not sure what > that is... > Debian Linux couldn't get it to work with imagemagick. wand-config not found I switched to graphicsmagick. (This also removes imagemagick) #tcl-dev and tk-dev are already installed apt install graphicsmagick-imagemagick-compat apt install graphicsmagick-libmagick-dev-compat Downloaded the graphicsmagick source and created the TclMagick subdirectory from it make ../configure make install (/usr/lib/TclMagick0.46) #a example #http://www.neatware.com/myrmecox/studio/ex_tclmagick.html