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.
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.
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.
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.
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.
Am 27.06.24 um 17:47 schrieb Andreas Leitgeb:
I'd like it to open a .png file (screenshot from an androidHello
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.
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
Am 27.06.24 um 17:47 schrieb Andreas Leitgeb:
I'd like it to open a .png file (screenshot from an androidHello
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.
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
GregorHello,
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
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
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...
Andreas Leitgeb <avl@logic.at> wrote:
I'd like it to open a .png file (screenshot from an androidThanks to all who answered...
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
Unfortunately, I haven't yet succeeded with any of the suggestions.
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 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
./configure
make install
#a example--- Synchronet 3.20a-Linux NewsLink 1.114
#http://www.neatware.com/myrmecox/studio/ex_tclmagick.html
So, please, let me know where you got 0.46 from.
With 0.45, this is what I get (now with graphicsmagick):
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.
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
make
./configure
make install
(/usr/lib/TclMagick0.46)
package require TclMagick
set wand [magick create wand]
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!
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]
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 970 |
Nodes: | 10 (2 / 8) |
Uptime: | 103:44:06 |
Calls: | 12,740 |
Calls today: | 2 |
Files: | 186,574 |
Messages: | 3,171,634 |