Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Debian Hint #6: There is no hint #6. Submit a hint today!


comp / comp.lang.tcl / Re: is there an image package that doesn't require Tk ?

SubjectAuthor
* is there an image package that doesn't require Tk ?Andreas Leitgeb
+- Re: is there an image package that doesn't require Tk ?Gerald Lester
+- Re: is there an image package that doesn't require Tk ?ted@loft.tnolan.com (Ted Nolan
+- Re: is there an image package that doesn't require Tk ?Harald Oehlmann
+- Re: is there an image package that doesn't require Tk ?Paul Obermeier
+* Re: is there an image package that doesn't require Tk ?greg
|+- Re: is there an image package that doesn't require Tk ?Harald Oehlmann
|`- Re: is there an image package that doesn't require Tk ?greg
`* Re: is there an image package that doesn't require Tk ?Andreas Leitgeb
 +- Re: is there an image package that doesn't require Tk ?ted@loft.tnolan.com (Ted Nolan
 +* Re: is there an image package that doesn't require Tk ?greg
 |`* Re: is there an image package that doesn't require Tk ?Andreas Leitgeb
 | +* Re: is there an image package that doesn't require Tk ?greg
 | |`* Re: is there an image package that doesn't require Tk ?Andreas Leitgeb
 | | `* Re: is there an image package that doesn't require Tk ?greg
 | |  `- Re: is there an image package that doesn't require Tk ?Andreas Leitgeb
 | `- Re: is there an image package that doesn't require Tk ?Christian Gollwitzer
 `- Re: is there an image package that doesn't require Tk ?Andreas Leitgeb

1
Subject: is there an image package that doesn't require Tk ?
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 27 Jun 2024 15:47 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: is there an image package that doesn't require Tk ?
Date: Thu, 27 Jun 2024 15:47:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <slrnv7r2cs.3gvbf.avl@logic.at>
Reply-To: avl@logic.at
Injection-Date: Thu, 27 Jun 2024 17:47:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8e74ff785fe80015af8937dfca316e6e";
logging-data="2930263"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VokCAGiMjGDuvS85NXRtR"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:yXh40eeOIhQTzCUrlv3pgvyajRc=
View all headers

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

For now, I use "image photo" to scrape(simple ocr) some numbers
from it, but it only works with Tk. In the end I want to do
the processing of the image in the same cron-script that gets
the screenshot from the phone.

If nothing else, I'd "convert" (from Imagemagick) the png to
something I can easier parse in Tcl.

Subject: Re: is there an image package that doesn't require Tk ?
From: Gerald Lester
Newsgroups: comp.lang.tcl
Organization: fastusenet - www.fastusenet.org
Date: Thu, 27 Jun 2024 16:22 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.swapon.de!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx48.iad.POSTED!not-for-mail
Message-ID: <e7cb9c04-d1e8-493e-a391-6b5316365ef1@gmail.com>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: is there an image package that doesn't require Tk ?
Newsgroups: comp.lang.tcl
References: <slrnv7r2cs.3gvbf.avl@logic.at>
Content-Language: en-US
From: Gerald.Lester@gmail.com (Gerald Lester)
In-Reply-To: <slrnv7r2cs.3gvbf.avl@logic.at>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 16
X-Complaints-To: abuse@fastusenet.org
NNTP-Posting-Date: Thu, 27 Jun 2024 16:22:05 UTC
Organization: fastusenet - www.fastusenet.org
Date: Thu, 27 Jun 2024 11:22:05 -0500
X-Received-Bytes: 1451
View all headers

On 6/27/24 10:47, 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
>
> For now, I use "image photo" to scrape(simple ocr) some numbers
> from it, but it only works with Tk. In the end I want to do
> the processing of the image in the same cron-script that gets
> the screenshot from the phone.
>
> If nothing else, I'd "convert" (from Imagemagick) the png to
> something I can easier parse in Tcl.
>

http://www.graphicsmagick.org/TclMagick/doc/TclMagick.html

Subject: Re: is there an image package that doesn't require Tk ?
From: ted@loft.tnolan.com
Newsgroups: comp.lang.tcl
Organization: loft
Date: Thu, 27 Jun 2024 16:31 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: @ednolan (ted@loft.tnolan.com (Ted Nolan)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: 27 Jun 2024 16:31:14 GMT
Organization: loft
Lines: 22
Message-ID: <le5ieiFqebuU1@mid.individual.net>
References: <slrnv7r2cs.3gvbf.avl@logic.at>
X-Trace: individual.net p+MTSkU5dObfxLisYOJt9Am0ZrirDhqczf7p/vEgUSjZaZkXUf
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:kaFSu032ym2Wq3OXANRL68piGuE= sha256:T0LgdAy/1rrTjrwKjn+QW89bCnOd2c4KAlirgDnRgnQ=
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
View all headers

In article <slrnv7r2cs.3gvbf.avl@logic.at>,
Andreas Leitgeb <avl@logic.at> 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
>
>For now, I use "image photo" to scrape(simple ocr) some numbers
>from it, but it only works with Tk. In the end I want to do
>the processing of the image in the same cron-script that gets
>the screenshot from the phone.
>
>If nothing else, I'd "convert" (from Imagemagick) the png to
>something I can easier parse in Tcl.
>

It's not clear to me if this still works, but there is:

https://wiki.tcl-lang.org/page/TclMagick
--
columbiaclosings.com
What's not in Columbia anymore..

Subject: Re: is there an image package that doesn't require Tk ?
From: Harald Oehlmann
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 27 Jun 2024 17:42 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Thu, 27 Jun 2024 19:42:28 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <v5k8a4$2r9ec$2@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 27 Jun 2024 19:42:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="654b9e4cd98c28ed3b1d56415691e53d";
logging-data="2991564"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lUwNInH/p6EM1u99TuqQR"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rvYo4s6uOdS2ZO+BN76nCai2Jd4=
In-Reply-To: <slrnv7r2cs.3gvbf.avl@logic.at>
Content-Language: en-GB
View all headers

Am 27.06.2024 um 17:47 schrieb Andreas Leitgeb:
> 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
>
> For now, I use "image photo" to scrape(simple ocr) some numbers
> from it, but it only works with Tk. In the end I want to do
> the processing of the image in the same cron-script that gets
> the screenshot from the phone.
>
> If nothing else, I'd "convert" (from Imagemagick) the png to
> something I can easier parse in Tcl.
>

To my knowledge, there is the CRIMP package by Andreas Kupries.

https://core.tcl-lang.org/akupries/crimp/home

And I would love to get the image code a loadable extension of Tk, so it
may be loaded without Tk.
I already looked into this. It is far from trivial, as there are many
direct interaction between widget code and core image code...

And I would love to remove a lot of old stuff from the image code. We
missed this with Tk 9.0...

Any help appreciated...

Thanks,
Harald

Subject: Re: is there an image package that doesn't require Tk ?
From: Paul Obermeier
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 27 Jun 2024 18:36 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: obermeier@poSoft.de (Paul Obermeier)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Thu, 27 Jun 2024 20:36:06 +0200
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <v5kber$2rt5f$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 27 Jun 2024 20:36:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="00f313b339e9216e1b1b0c72b6627c10";
logging-data="3011759"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v18aisVTr9VdfQvmpd/H1hX9QOjEc/C4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:COQK27v1wmv9Aqhn+WgaCwUjaJw=
In-Reply-To: <slrnv7r2cs.3gvbf.avl@logic.at>
View all headers

You may look at tclgd (https://github.com/flightaware/tcl.gd).
A working version is part of BAWT.

Paul

Am 27.06.2024 um 17:47 schrieb Andreas Leitgeb:
> 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
>
> For now, I use "image photo" to scrape(simple ocr) some numbers
> from it, but it only works with Tk. In the end I want to do
> the processing of the image in the same cron-script that gets
> the screenshot from the phone.
>
> If nothing else, I'd "convert" (from Imagemagick) the png to
> something I can easier parse in Tcl.
>

Subject: Re: is there an image package that doesn't require Tk ?
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 27 Jun 2024 19:38 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Thu, 27 Jun 2024 21:38:09 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <v5kf31$2sftj$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 27 Jun 2024 21:38:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="061d4f5bff545b32472a91ff0c1bbd5d";
logging-data="3030963"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OUrgnZ3QlIWmacnumehJnn9YzsTLHw6M="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JTl9l6+yxyPt286//Xb4M3mxsmU=
Content-Language: de-DE
In-Reply-To: <slrnv7r2cs.3gvbf.avl@logic.at>
View all headers

Am 27.06.24 um 17:47 schrieb Andreas Leitgeb:
> 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
>
> For now, I use "image photo" to scrape(simple ocr) some numbers
> from it, but it only works with Tk. In the end I want to do
> the processing of the image in the same cron-script that gets
> the screenshot from the phone.
>
> If nothing else, I'd "convert" (from Imagemagick) the png to
> something I can easier parse in Tcl.
>
Hello

https://wiki.tcl-lang.org/page/Pixane

via webarchives
but without source code and no binaries for win 64

It works with Linux 32 and 64 bit

Gregor

Subject: Re: is there an image package that doesn't require Tk ?
From: Harald Oehlmann
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 28 Jun 2024 06:29 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Fri, 28 Jun 2024 08:29:49 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <v5ll8s$37idd$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <v5kf31$2sftj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 28 Jun 2024 08:29:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="62ad14c5327c746d1c242dc7abe6364e";
logging-data="3393965"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YsjCEDlO34TVrtacoor1M"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:QiON5STatLKfFA6AHuYnMgA2A6Q=
Content-Language: en-GB
In-Reply-To: <v5kf31$2sftj$1@dont-email.me>
View all headers

Am 27.06.2024 um 21:38 schrieb greg:
> Am 27.06.24 um 17:47 schrieb Andreas Leitgeb:
>> 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
>>
>> For now, I use "image photo" to scrape(simple ocr) some numbers
>> from it, but it only works with Tk.  In the end I want to do
>> the processing of the image in the same cron-script that gets
>> the screenshot from the phone.
>>
>> If nothing else, I'd "convert" (from Imagemagick) the png to
>> something I can easier parse in Tcl.
>>
> Hello
>
> https://wiki.tcl-lang.org/page/Pixane
>
>
> via webarchives
> but without source code and no binaries for win 64
>
> It works with Linux 32 and 64 bit
>
>
> Gregor

Yes, as there is no standard package, there are many solutions.
That is why I would like the image command from Tk as a loadable package
for TCL.

Thanks,
Harald

Subject: Re: is there an image package that doesn't require Tk ?
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 28 Jun 2024 18:16 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Fri, 28 Jun 2024 20:16:10 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <v5mula$3f0kd$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <v5kf31$2sftj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 28 Jun 2024 20:16:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c024adf967907dc190de90568a43e1d";
logging-data="3637901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18i56dAFbEZNiQ7c/QlOValanbJM6f1pMw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:WhY+TcSBFvD/NPnOr0UQeCO+/Bk=
Content-Language: de-DE
In-Reply-To: <v5kf31$2sftj$1@dont-email.me>
View all headers

Am 27.06.24 um 21:38 schrieb greg:
> Am 27.06.24 um 17:47 schrieb Andreas Leitgeb:
>> 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
>>
>> For now, I use "image photo" to scrape(simple ocr) some numbers
>> from it, but it only works with Tk.  In the end I want to do
>> the processing of the image in the same cron-script that gets
>> the screenshot from the phone.
>>
>> If nothing else, I'd "convert" (from Imagemagick) the png to
>> something I can easier parse in Tcl.
>>
> Hello
>
> https://wiki.tcl-lang.org/page/Pixane
>
>
> via webarchives
> but without source code and no binaries for win 64
>
> It works with Linux 32 and 64 bit
>
>
> Gregor
Hello,

a different but current package
https://github.com/ray2501/tcl-stbimage

Gregor

Subject: Re: is there an image package that doesn't require Tk ?
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 28 Jun 2024 22:07 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Fri, 28 Jun 2024 22:07:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <slrnv7ud1t.3gvbf.avl@logic.at>
References: <slrnv7r2cs.3gvbf.avl@logic.at>
Reply-To: avl@logic.at
Injection-Date: Sat, 29 Jun 2024 00:07:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3b8fe3cb84f491ba853011c784952244";
logging-data="3724001"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mwVEdwSXy46BFxbXOu2lW"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:XAjk0q+SdMAFNIfC6/DDKjtju5Q=
View all headers

Andreas Leitgeb <avl@logic.at> 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...

Subject: Re: is there an image package that doesn't require Tk ?
From: ted@loft.tnolan.com
Newsgroups: comp.lang.tcl
Organization: loft
Date: Sat, 29 Jun 2024 05:19 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: @ednolan (ted@loft.tnolan.com (Ted Nolan)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: 29 Jun 2024 05:19:27 GMT
Organization: loft
Lines: 35
Message-ID: <le9jquFeig3U1@mid.individual.net>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
X-Trace: individual.net 3vcnlAtkbmgFY4TKNu9TbQ5xoDBZH6aT3zxxTm2Hm/hkgbXWTr
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:gylly8R3WHl/m3vAXrncdus0Me8= sha256:2JCYXPX/1d0YQfGK91OLHH6JSp92p06NarTLuAebXBc=
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
View all headers

In article <slrnv7ud1t.3gvbf.avl@logic.at>,
Andreas Leitgeb <avl@logic.at> wrote:
>Andreas Leitgeb <avl@logic.at> 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
>

I'm not pushing the package, as all I know about it is that it exists,
but that sounds like maybe you should link against the stubs library,
libtclstub86.a (on my FreeBSD) rather than libtcl86.so/libtcl86.a
--
columbiaclosings.com
What's not in Columbia anymore..

Subject: Re: is there an image package that doesn't require Tk ?
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 29 Jun 2024 07:35 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (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: <v5odfu$3qqpt$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
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: <slrnv7ud1t.3gvbf.avl@logic.at>
View all headers

Am 29.06.24 um 00:07 schrieb Andreas Leitgeb:
> Andreas Leitgeb <avl@logic.at> 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

Subject: Re: is there an image package that doesn't require Tk ?
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sun, 30 Jun 2024 16:58 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Sun, 30 Jun 2024 16:58:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <slrnv833ko.3gvbf.avl@logic.at>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
Reply-To: avl@logic.at
Injection-Date: Sun, 30 Jun 2024 18:58:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0f0d69220911df9582555624287e7151";
logging-data="627975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kBM9NzMsK0vtj4VXfIV/p"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:5Zvov7Z3UyMtpieJU8SU7//D7go=
View all headers

Andreas Leitgeb <avl@logic.at> wrote:
> Andreas Leitgeb <avl@logic.at> 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.

I didn't mean to make anyone "responsible" in any way for a suggestion
made - quite the opposite: I was happy for all suggestions.

In the end I went without tcl package, and merely invoke the
imagemagick tool "convert" with a list of parameters such that
it writes out an uncompressed bmp3 in 16-colors (palette) mode,
which turned out pretty simple to parse from Tcl code (binary scan).

Given a "list-of-list-of-color", it is amazingly simple
to extract a sub-rectangle:

proc rect {data x1 y1 x2 y2} {
lmap row [lrange $data $y1 $y2] { lrange $row $x1 $x2 }
}

Case closed ;-)

Subject: Re: is there an image package that doesn't require Tk ?
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sun, 30 Jun 2024 19:05 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Sun, 30 Jun 2024 19:05:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <slrnv83b2u.3gvbf.avl@logic.at>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
<v5odfu$3qqpt$1@dont-email.me>
Reply-To: avl@logic.at
Injection-Date: Sun, 30 Jun 2024 21:05:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0f0d69220911df9582555624287e7151";
logging-data="699235"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+23AYcmZj0D+xnXxZIZLNE"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:8e25l3H08LvHkfVJpHYixr3KuLU=
View all headers

greg <gregor.ebbing@gmx.de> wrote:
> Am 29.06.24 um 00:07 schrieb Andreas Leitgeb:
>> http://www.graphicsmagick.org/TclMagick/doc/TclMagick.html
>> 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

I gave it another try afterall - with graphicsmagick.

> 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

Ok, did that, too...

> Downloaded the graphicsmagick source and created the TclMagick
> subdirectory from it

You seem to have found a version 0.46 ...

The link to sourceforge seems to offer only 0.40 to 0.45 (all
from year 2005) and their cvs servers seem no longer active
(connection timeout after about 2 minutes)

So, please, let me know where you got 0.46 from.

With 0.45, this is what I get (now with graphicsmagick):

> ./configure

With those graphicsmagick packages installed, there existed now
an executable /usr/bin/Wand-config which I had to pass to configure
as: --with-magick=/usr/bin/Wand-config

(otherwise, configure would abort with "configure: error: You must
specify the Graphics/ImageMagick-config script with --with-magick!")

> make install

build-process emits a big number of warnings, about sign-conversions...
but it seems to end with success.

This is the line that creates the dynamic lib:

gcc -shared .libs/libTclMagick_la-TclMagick.o -L/usr/lib -ldl
-lGraphicsMagickWand -lGraphicsMagick -ljbig -lwebp -lwebpmux -lheif
-lde265 -llcms2 -ltiff -lfreetype -ljpeg -lpng16 -lwmflite -lXext -lSM
-lICE -lX11 -llzma -lbz2 -lxml2 -lz -lzstd -lm -lpthread -lgomp
-Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-soname
-Wl,libTclMagick.so.0 -o .libs/libTclMagick.so.0.0.0

To my surprise, this neither links to stubs nor to any -ltcl at all.

But still:
$ tclsh
% package require TclMagick
couldn't load file "/usr/local/lib/TclMagick0.45/libTclMagick.so":
/usr/local/lib/TclMagick0.45/libTclMagick.so: undefined symbol:
tclStubsPtr
%

I don't see how I could change any linking to stubs...
Adding --with-tcl=/path/to/tcl8.6.14/unix to configure also didn't
change anything.

> #a example
> #http://www.neatware.com/myrmecox/studio/ex_tclmagick.html

Subject: Re: is there an image package that doesn't require Tk ?
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sun, 30 Jun 2024 20:04 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Sun, 30 Jun 2024 22:04:48 +0200
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <v5sdp0$lrni$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
<v5odfu$3qqpt$1@dont-email.me> <slrnv83b2u.3gvbf.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 30 Jun 2024 22:04:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="88fa8f104328984dcc733a9ed91a4671";
logging-data="716530"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/XQ+qhpaug42tYwCbkUU4tioKtKM3077c="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:86VVOOfc0oezvH8Ex8KLTlQt8dc=
Content-Language: de-DE
In-Reply-To: <slrnv83b2u.3gvbf.avl@logic.at>
View all headers

Am 30.06.24 um 21:05 schrieb Andreas Leitgeb:

> So, please, let me know where you got 0.46 from.
>
>
> With 0.45, this is what I get (now with graphicsmagick):
>

Hello

First of all:
the scripts from test work except for

$wand DrawImage $draw
#Magick: abort due to signal 11 (SIGSEGV) "Segmentation Fault"...
#no solution, a bug?

https://sourceforge.net/projects/graphicsmagick/files/

Download Latest version
GraphicsMagick-1.3.43.tar.xz
in
GraphicsMagick-1.3.43.tar.xz
is TclMagick 0.46

make
../configure
make install
(/usr/lib/TclMagick0.46)

package require TclMagick

set wand [magick create wand]
if {[catch {$wand ReadImage sample.png} err]} {
puts "Error reading image: $err"
exit
}

set width 100
set height 100
set x 50
set y 50

if {[catch {$wand CropImage $width $height $x $y} err]} {
puts "Error cropping image: $err"
exit
}

if {[catch {$wand WriteImage cropped_sample.png} err]} {
puts "Error writing cropped image: $err"
exit
}

magick delete $wand

Subject: Re: is there an image package that doesn't require Tk ?
From: Christian Gollwitzer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 1 Jul 2024 12:19 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Mon, 1 Jul 2024 14:19:28 +0200
Organization: A noiseless patient Spider
Lines: 95
Message-ID: <v5u6sh$12nou$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
<v5odfu$3qqpt$1@dont-email.me> <slrnv83b2u.3gvbf.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 01 Jul 2024 14:19:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f030dadaeb42a66c8ba7cf7ca01d51df";
logging-data="1138462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19c/qG5v3CAb8bwcCw/XULLylUBVGw4pA0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4922zdm/D4jjz9xWhMwv4w8oqac=
In-Reply-To: <slrnv83b2u.3gvbf.avl@logic.at>
View all headers

Am 30.06.24 um 21:05 schrieb Andreas Leitgeb:
> greg <gregor.ebbing@gmx.de> wrote:
>> Am 29.06.24 um 00:07 schrieb Andreas Leitgeb:
>>> http://www.graphicsmagick.org/TclMagick/doc/TclMagick.html
>>> 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
>
> I gave it another try afterall - with graphicsmagick.
>
>> 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
>
> Ok, did that, too...
>
>> Downloaded the graphicsmagick source and created the TclMagick
>> subdirectory from it
>
> You seem to have found a version 0.46 ...
>
> The link to sourceforge seems to offer only 0.40 to 0.45 (all
> from year 2005) and their cvs servers seem no longer active
> (connection timeout after about 2 minutes)
>
> So, please, let me know where you got 0.46 from.
>
>
> With 0.45, this is what I get (now with graphicsmagick):
>
>> ./configure
>
> With those graphicsmagick packages installed, there existed now
> an executable /usr/bin/Wand-config which I had to pass to configure
> as: --with-magick=/usr/bin/Wand-config
>
> (otherwise, configure would abort with "configure: error: You must
> specify the Graphics/ImageMagick-config script with --with-magick!")
>
>> make install
>
> build-process emits a big number of warnings, about sign-conversions...
> but it seems to end with success.
>
> This is the line that creates the dynamic lib:
>
> gcc -shared .libs/libTclMagick_la-TclMagick.o -L/usr/lib -ldl
> -lGraphicsMagickWand -lGraphicsMagick -ljbig -lwebp -lwebpmux -lheif
> -lde265 -llcms2 -ltiff -lfreetype -ljpeg -lpng16 -lwmflite -lXext -lSM
> -lICE -lX11 -llzma -lbz2 -lxml2 -lz -lzstd -lm -lpthread -lgomp
> -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-soname
> -Wl,libTclMagick.so.0 -o .libs/libTclMagick.so.0.0.0
>
> To my surprise, this neither links to stubs nor to any -ltcl at all.
>
that seems to be the issue. Te good news is that if tclStubsPtr is
undefined, it is indeed compiled against the stubs version. SO simply
relinking with the stubs linb should do.

> But still:
> $ tclsh
> % package require TclMagick
> couldn't load file "/usr/local/lib/TclMagick0.45/libTclMagick.so":
> /usr/local/lib/TclMagick0.45/libTclMagick.so: undefined symbol:
> tclStubsPtr
> %

Expected
>
> I don't see how I could change any linking to stubs...
> Adding --with-tcl=/path/to/tcl8.6.14/unix to configure also didn't
> change anything.

You can force-add a linker line to configure, usually like this:

LIBS="-ltclstub8.5" LDFLAGS="-L<path_to_tclstub>" ./configure
....yourotheroptions....

If you need to tweak the LIBS and LDFLAGS this should bail out early
when trying to compile test programs.

Christian

Subject: Re: is there an image package that doesn't require Tk ?
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 1 Jul 2024 17:55 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Mon, 1 Jul 2024 17:55:39 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <slrnv85rcr.3gvbf.avl@logic.at>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
<v5odfu$3qqpt$1@dont-email.me> <slrnv83b2u.3gvbf.avl@logic.at>
<v5sdp0$lrni$1@dont-email.me>
Reply-To: avl@logic.at
Injection-Date: Mon, 01 Jul 2024 19:55:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4b99c451c4a1716499a82b7ed609deaa";
logging-data="1257698"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6oHCGLteaRQRqwDG6dGkQ"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:igjAhxPmSp3erlnliDV7po/AyfA=
View all headers

greg <gregor.ebbing@gmx.de> wrote:
> Am 30.06.24 um 21:05 schrieb Andreas Leitgeb:
>> So, please, let me know where you got 0.46 from.
> https://sourceforge.net/projects/graphicsmagick/files/
>
> Download Latest version
> GraphicsMagick-1.3.43.tar.xz
> in
> GraphicsMagick-1.3.43.tar.xz
> is TclMagick 0.46

Thanks, now I got it :-)

> make
> ./configure
> make install
> (/usr/lib/TclMagick0.46)

> package require TclMagick

I got this too, now, so it seems like the stubs-thing was
fixed in this 0.46 :-)

> set wand [magick create wand]

Yes, the extension seems to work in principle, but it seems
like graphicsmagick dropped the "-copy" feature from "convert",
which I'd have had good use for... Also I got it into seg-
faults a couple of times, as well, but maybe my commands were
just bad.

Querying "pixels" just didn't do anything visible with an
empty "map"-argument, and segfaulted with whatever else I
tried for that argument. Maybe I read the docs not well enough..

My current solution involves "-copy" to copy certain "far-off"
parts of the image into a more central part, then only convert
the smaller region around the central parts to bmp3 format.

I might try this TclMagick 0.46 with original imagemagick,
to see if that gives me a "copy" subcommand for $wand.

And I've yet to study the docs better to see how "pixel" is
really to be used.

Thanks 2 all!

Subject: Re: is there an image package that doesn't require Tk ?
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 22:21 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Wed, 3 Jul 2024 00:21:20 +0200
Organization: A noiseless patient Spider
Lines: 88
Message-ID: <v61uh0$1qi1d$1@dont-email.me>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
<v5odfu$3qqpt$1@dont-email.me> <slrnv83b2u.3gvbf.avl@logic.at>
<v5sdp0$lrni$1@dont-email.me> <slrnv85rcr.3gvbf.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 03 Jul 2024 00:21:21 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e4c2fc55b3de6a6dea2a22b74448d4a0";
logging-data="1919021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19p8tDjvXpAzCFappKLhj3G6jfqMsiB3Mo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:bIQiJDz47zaPsrQW/aV6p7vXlQM=
In-Reply-To: <slrnv85rcr.3gvbf.avl@logic.at>
Content-Language: de-DE
View all headers

Am 01.07.24 um 19:55 schrieb Andreas Leitgeb:
> greg <gregor.ebbing@gmx.de> wrote:
>> Am 30.06.24 um 21:05 schrieb Andreas Leitgeb:
>>> So, please, let me know where you got 0.46 from.
>> https://sourceforge.net/projects/graphicsmagick/files/
>>
>> Download Latest version
>> GraphicsMagick-1.3.43.tar.xz
>> in
>> GraphicsMagick-1.3.43.tar.xz
>> is TclMagick 0.46
>
> Thanks, now I got it :-)
>
>> make
>> ./configure
>> make install
>> (/usr/lib/TclMagick0.46)
>
>> package require TclMagick
>
> I got this too, now, so it seems like the stubs-thing was
> fixed in this 0.46 :-)
>
>> set wand [magick create wand]
>
> Yes, the extension seems to work in principle, but it seems
> like graphicsmagick dropped the "-copy" feature from "convert",
> which I'd have had good use for... Also I got it into seg-
> faults a couple of times, as well, but maybe my commands were
> just bad.
>
> Querying "pixels" just didn't do anything visible with an
> empty "map"-argument, and segfaulted with whatever else I
> tried for that argument. Maybe I read the docs not well enough..
>
> My current solution involves "-copy" to copy certain "far-off"
> parts of the image into a more central part, then only convert
> the smaller region around the central parts to bmp3 format.
>
> I might try this TclMagick 0.46 with original imagemagick,
> to see if that gives me a "copy" subcommand for $wand.
>
> And I've yet to study the docs better to see how "pixel" is
> really to be used.
>
> Thanks 2 all!

# bißchen rumprobiert
# setPixel
# parts of it from TclMagick/tests
set width 100
set height 100
set x 50
set y 50

# new blank picture
# xc:$color" from
# http://www.graphicsmagick.org/formats.html
set wand [magick create wand]
set color white
$wand ReadImage "xc:$color"
$wand ResizeImage $width $height cubic

# Create the binary data for red pixels
# Each pixel requires 3 bytes (RGB), 80x10 pixels
set red_pixel_data [string repeat [binary format c* {255 0 0}] [expr
80 * 10]]
$wand SetPixels 0 0 80 10 "RGB" char $red_pixel_data
$wand WriteImage empty-wr1.png

# GetPixel
set extracted_pixels [$wand GetPixels 10 5 80 10 "RGB" char]
# Paste the extracted region to a new location
$wand SetPixels 20 30 80 10 "RGB" char $extracted_pixels
$wand WriteImage empty-wr2.png

set pixel_color [$wand GetPixels 15 7 1 1 "RGB" char]
binary scan $pixel_color c* rgb_values
set red [lindex $rgb_values 0]
set green [lindex $rgb_values 1]
set blue [lindex $rgb_values 2]
puts "Color of pixel at (15, 7): red=$red, green=$green, blue=$blue"

magick delete $wand

# copy with clone?
# set cwand [$wand clone]

Subject: Re: is there an image package that doesn't require Tk ?
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 3 Jul 2024 16:53 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: is there an image package that doesn't require Tk ?
Date: Wed, 3 Jul 2024 16:53:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <slrnv8b0fr.3gvbf.avl@logic.at>
References: <slrnv7r2cs.3gvbf.avl@logic.at> <slrnv7ud1t.3gvbf.avl@logic.at>
<v5odfu$3qqpt$1@dont-email.me> <slrnv83b2u.3gvbf.avl@logic.at>
<v5sdp0$lrni$1@dont-email.me> <slrnv85rcr.3gvbf.avl@logic.at>
<v61uh0$1qi1d$1@dont-email.me>
Reply-To: avl@logic.at
Injection-Date: Wed, 03 Jul 2024 18:53:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="840f8569fa25659792f9f88e30723f57";
logging-data="2400301"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19r+2Uyhde84ETPNGcaus3X"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:tlhbLDvk3Zk1sw9oIPZv0pLK9DI=
View all headers

A big THANK YOU!!

greg <gregor.ebbing@gmx.de> wrote:
>> Querying "pixels" just didn't do anything visible with an
>> empty "map"-argument, and segfaulted with whatever else I
>> tried for that argument. Maybe I read the docs not well enough..

> set extracted_pixels [$wand GetPixels 10 5 80 10 "RGB" char]

This was the key...

Seeing "GetPixels" at work got me trying again...

I now just load the original pic into (GraphicsMagick-powered)
TclMagick0.46 and use GetPixels for the rectangles I need to
examine...

and it became like *5 times faster* than my previous approach
with calling "convert" and parsing it's output. :-)

1

rocksolid light 0.9.8
clearnet tor