Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

I THINK MAN INVENTED THE CAR by instinct. -- Jack Handey, The New Mexican, 1988.


devel / comp.lang.tcl / Re: Modify individual bitmap image pixels

SubjectAuthor
* Modify individual image pixelsManuel Collado
`* Modify individual image pixelsHarald Oehlmann
 `* Modify individual bitmap image pixelsManuel Collado
  `* Modify individual bitmap image pixelsJim Jackson
   `* Modify individual bitmap image pixelsRich
    `* Modify individual bitmap image pixelsJim Jackson
     `- Modify individual bitmap image pixelsbriang

1
Modify individual image pixels

<uid2c4$uurt$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12730&group=comp.lang.tcl#12730

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mcollado2011@gmail.com (Manuel Collado)
Newsgroups: comp.lang.tcl
Subject: Modify individual image pixels
Date: Tue, 7 Nov 2023 11:09:08 +0100
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <uid2c4$uurt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 7 Nov 2023 10:09:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e93ca11b8133301f970127bf5be9b975";
logging-data="1014653"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/YINqDYxP765yPEFMiCZsyZiOzU1AB0k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0NFlz0hl6ulTgghQ8VWKYUR8LiA=
Content-Language: en-US
 by: Manuel Collado - Tue, 7 Nov 2023 10:09 UTC

The subject line says all. Is there a way to create/modify a bitmap
image on screen pixelwise?

Until now I've only found the possibility to redraw the whole image
after individual pixel changes.

Thanks in advance.
--
Manuel Collado - http://mcollado.z15.es

Re: Modify individual image pixels

<uid529$vfd0$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12732&group=comp.lang.tcl#12732

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.samoylyk.net!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: Modify individual image pixels
Date: Tue, 7 Nov 2023 11:55:05 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uid529$vfd0$2@dont-email.me>
References: <uid2c4$uurt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 7 Nov 2023 10:55:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9f76213ad5103e5eb049ce2807cd8870";
logging-data="1031584"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xYW8Eo5oOqAZuwnENfVRY"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nuIE1b3PoztopfMhRq3h3b3WRDU=
In-Reply-To: <uid2c4$uurt$1@dont-email.me>
Content-Language: en-GB
 by: Harald Oehlmann - Tue, 7 Nov 2023 10:55 UTC

Am 07.11.2023 um 11:09 schrieb Manuel Collado:
> The subject line says all. Is there a way to create/modify a bitmap
> image on screen pixelwise?
>
> Until now I've only found the possibility to redraw the whole image
> after individual pixel changes.
>
> Thanks in advance.

Yes, there is.

https://www.tcl-lang.org/man/tcl8.6/TkCmd/photo.htm#M30

You will need Tk 8.7 to manipulate the full alpha channel.

Enjoy,
Harald

Re: Modify individual bitmap image pixels

<uifumq$1jg4r$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12740&group=comp.lang.tcl#12740

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mcollado2011@gmail.com (Manuel Collado)
Newsgroups: comp.lang.tcl
Subject: Re: Modify individual bitmap image pixels
Date: Wed, 8 Nov 2023 13:24:58 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uifumq$1jg4r$1@dont-email.me>
References: <uid2c4$uurt$1@dont-email.me> <uid529$vfd0$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 8 Nov 2023 12:24:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6cd4c129138bcf672bee29e766ab0072";
logging-data="1687707"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ujoiOOH+7WwYU6ejANf6o2+DJ0bNjP78="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:kj8DY/f+hrFM9kgMAQhA/NKwhZ4=
Content-Language: en-US, es-ES
In-Reply-To: <uid529$vfd0$2@dont-email.me>
 by: Manuel Collado - Wed, 8 Nov 2023 12:24 UTC

El 7/11/23 a las 11:55, Harald Oehlmann escribió:
> Am 07.11.2023 um 11:09 schrieb Manuel Collado:
>> The subject line says all. Is there a way to create/modify a bitmap
>> image on screen pixelwise?
>>
>> Until now I've only found the possibility to redraw the whole image
>> after individual pixel changes.
>>
>> Thanks in advance.
>
> Yes, there is.
>
> https://www.tcl-lang.org/man/tcl8.6/TkCmd/photo.htm#M30
>
> You will need Tk 8.7 to manipulate the full alpha channel.

Sorry for not being clear enough. Subject updated. I'm working on bitmap
images. The 'put' image command seems to be only available for photos.

Anyway thanks for your hint. Perhaps I should consider using photos
instead of bitmaps.

--
Manuel Collado - http://mcollado.z15.es

Re: Modify individual bitmap image pixels

<slrnukniki.26p.jj@iridium.wf32df>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12745&group=comp.lang.tcl#12745

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.nntp4.net!speedkom.net!fu-berlin.de!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.lang.tcl
Subject: Re: Modify individual bitmap image pixels
Date: Wed, 8 Nov 2023 17:51:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <slrnukniki.26p.jj@iridium.wf32df>
References: <uid2c4$uurt$1@dont-email.me> <uid529$vfd0$2@dont-email.me>
<uifumq$1jg4r$1@dont-email.me>
Injection-Date: Wed, 8 Nov 2023 17:51:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="012f6746f9f03064eb64084111819111";
logging-data="1804174"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AtA4dY4ExRtSTktVmaAt1oNeqIXlMsAI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:Lc6tKEXk7PIHPQlik6PNuircgr0=
 by: Jim Jackson - Wed, 8 Nov 2023 17:51 UTC

On 2023-11-08, Manuel Collado <mcollado2011@gmail.com> wrote:
> El 7/11/23 a las 11:55, Harald Oehlmann escribi??:
>> Am 07.11.2023 um 11:09 schrieb Manuel Collado:
>>> The subject line says all. Is there a way to create/modify a bitmap
>>> image on screen pixelwise?
>>>
>>> Until now I've only found the possibility to redraw the whole image
>>> after individual pixel changes.
>>>
>>> Thanks in advance.
>>
>> Yes, there is.
>>
>> https://www.tcl-lang.org/man/tcl8.6/TkCmd/photo.htm#M30
>>
>> You will need Tk 8.7 to manipulate the full alpha channel.
>
> Sorry for not being clear enough. Subject updated. I'm working on bitmap
> images. The 'put' image command seems to be only available for photos.
>
> Anyway thanks for your hint. Perhaps I should consider using photos
> instead of bitmaps.

Sorry is there a difference? A photo is an image and both are displayed
as some form of bitmap.

Surely if you have some image decoded in memory as a bitmap, it is just
some sort of array or values, probably 24 bit RGB values. All you do is
alter the number sin the array with your new numbers, and pass altered
array for display. Or are you wanting to actually alter the numbers in
the buffer on the memory card?

Re: Modify individual bitmap image pixels

<uigvgn$1q3lj$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12747&group=comp.lang.tcl#12747

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.swapon.de!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Modify individual bitmap image pixels
Date: Wed, 8 Nov 2023 21:44:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <uigvgn$1q3lj$1@dont-email.me>
References: <uid2c4$uurt$1@dont-email.me> <uid529$vfd0$2@dont-email.me> <uifumq$1jg4r$1@dont-email.me> <slrnukniki.26p.jj@iridium.wf32df>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 8 Nov 2023 21:44:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f1dd542b1955a6b3d9279b8751d2c401";
logging-data="1904307"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hCQ5iEMmmOTGLdEszYeVz"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:zbXW3ePwRdweDYCbXD1z9C6LyIw=
 by: Rich - Wed, 8 Nov 2023 21:44 UTC

Jim Jackson <jj@franjam.org.uk> wrote:
> On 2023-11-08, Manuel Collado <mcollado2011@gmail.com> wrote:
>> El 7/11/23 a las 11:55, Harald Oehlmann escribi??:
>>> Am 07.11.2023 um 11:09 schrieb Manuel Collado:
>>>> The subject line says all. Is there a way to create/modify a bitmap
>>>> image on screen pixelwise?
>>
>> ...
>>
>> Anyway thanks for your hint. Perhaps I should consider using photos
>> instead of bitmaps.
>
> Sorry is there a difference? A photo is an image and both are displayed
> as some form of bitmap.

From the perspective of the image data, no.

For Tcl, it defines two different "image types":

man n image:

BUILT-IN IMAGE TYPES
The following image types are defined by Tk so they will be
available in any Tk application. Individual applications or
extensions may define additional types.

bitmap Each pixel in the image displays a foreground color, a
back‐ground color, or nothing. See the bitmap manual
entry for more information.

photo Displays a variety of full-color images, using dithering to ap‐
proximate colors on displays with limited color
capabilities. See the photo manual entry for more
information.

And the available Tcl sub-commands for manipulating the two different
types of images are different.

Re: Modify individual bitmap image pixels

<slrnukpmb6.261.jj@iridium.wf32df>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12771&group=comp.lang.tcl#12771

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.lang.tcl
Subject: Re: Modify individual bitmap image pixels
Date: Thu, 9 Nov 2023 13:06:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <slrnukpmb6.261.jj@iridium.wf32df>
References: <uid2c4$uurt$1@dont-email.me> <uid529$vfd0$2@dont-email.me>
<uifumq$1jg4r$1@dont-email.me> <slrnukniki.26p.jj@iridium.wf32df>
<uigvgn$1q3lj$1@dont-email.me>
Injection-Date: Thu, 9 Nov 2023 13:06:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="927a85f04d9aa92047735e3c76568fa2";
logging-data="2315470"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Pm9ET13XcqiTrzUc4kgcvz6yp9yAG7KE="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:fXn4KuCOA0h97WrXngO4VXE+QVg=
 by: Jim Jackson - Thu, 9 Nov 2023 13:06 UTC

On 2023-11-08, Rich <rich@example.invalid> wrote:
> Jim Jackson <jj@franjam.org.uk> wrote:
>> On 2023-11-08, Manuel Collado <mcollado2011@gmail.com> wrote:
>>> El 7/11/23 a las 11:55, Harald Oehlmann escribi??:
>>>> Am 07.11.2023 um 11:09 schrieb Manuel Collado:
>>>>> The subject line says all. Is there a way to create/modify a bitmap
>>>>> image on screen pixelwise?
>>>
>>> ...
>>>
>>> Anyway thanks for your hint. Perhaps I should consider using photos
>>> instead of bitmaps.
>>
>> Sorry is there a difference? A photo is an image and both are displayed
>> as some form of bitmap.
>
> From the perspective of the image data, no.
>
> For Tcl, it defines two different "image types":
>
> man n image:
>
> BUILT-IN IMAGE TYPES
> The following image types are defined by Tk so they will be
> available in any Tk application. Individual applications or
> extensions may define additional types.
>
> bitmap Each pixel in the image displays a foreground color, a
> back???ground color, or nothing. See the bitmap manual
> entry for more information.
>
> photo Displays a variety of full-color images, using dithering to ap???
> proximate colors on displays with limited color
> capabilities. See the photo manual entry for more
> information.
>
> And the available Tcl sub-commands for manipulating the two different
> types of images are different.
>

Re: Modify individual bitmap image pixels

<63c55d0a-f440-4685-873f-f920f714a2d5n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12772&group=comp.lang.tcl#12772

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:4286:0:b0:420:210c:6511 with SMTP id o6-20020ac84286000000b00420210c6511mr157325qtl.1.1699546730787;
Thu, 09 Nov 2023 08:18:50 -0800 (PST)
X-Received: by 2002:a63:4c52:0:b0:5bd:d721:94c5 with SMTP id
m18-20020a634c52000000b005bdd72194c5mr490652pgl.6.1699546730410; Thu, 09 Nov
2023 08:18:50 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 9 Nov 2023 08:18:49 -0800 (PST)
In-Reply-To: <slrnukpmb6.261.jj@iridium.wf32df>
Injection-Info: google-groups.googlegroups.com; posting-host=192.183.219.24; posting-account=f4QznQoAAAAjupLEpV87s_G-96g1Io1w
NNTP-Posting-Host: 192.183.219.24
References: <uid2c4$uurt$1@dont-email.me> <uid529$vfd0$2@dont-email.me>
<uifumq$1jg4r$1@dont-email.me> <slrnukniki.26p.jj@iridium.wf32df>
<uigvgn$1q3lj$1@dont-email.me> <slrnukpmb6.261.jj@iridium.wf32df>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <63c55d0a-f440-4685-873f-f920f714a2d5n@googlegroups.com>
Subject: Re: Modify individual bitmap image pixels
From: bgriffinfortytwo@gmail.com (briang)
Injection-Date: Thu, 09 Nov 2023 16:18:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3547
 by: briang - Thu, 9 Nov 2023 16:18 UTC

On Thursday, November 9, 2023 at 5:06:52 AM UTC-8, Jim Jackson wrote:
> On 2023-11-08, Rich <ri...@example.invalid> wrote:
> > Jim Jackson <j...@franjam.org.uk> wrote:
> >> On 2023-11-08, Manuel Collado <mcolla...@gmail.com> wrote:
> >>> El 7/11/23 a las 11:55, Harald Oehlmann escribi??:
> >>>> Am 07.11.2023 um 11:09 schrieb Manuel Collado:
> >>>>> The subject line says all. Is there a way to create/modify a bitmap
> >>>>> image on screen pixelwise?
> >>>
> >>> ...
> >>>
> >>> Anyway thanks for your hint. Perhaps I should consider using photos
> >>> instead of bitmaps.
> >>
> >> Sorry is there a difference? A photo is an image and both are displayed
> >> as some form of bitmap.
> >
> > From the perspective of the image data, no.
> >
> > For Tcl, it defines two different "image types":
> >
> > man n image:
> >
> > BUILT-IN IMAGE TYPES
> > The following image types are defined by Tk so they will be
> > available in any Tk application. Individual applications or
> > extensions may define additional types.
> >
> > bitmap Each pixel in the image displays a foreground color, a
> > back???ground color, or nothing. See the bitmap manual
> > entry for more information.
> >
> > photo Displays a variety of full-color images, using dithering to ap???
> > proximate colors on displays with limited color
> > capabilities. See the photo manual entry for more
> > information.
> >
> > And the available Tcl sub-commands for manipulating the two different
> > types of images are different.
> >

For bitmaps, you can define the image via a string.
To modify the image, modify the original string, then do a configure -data on the image to update the view.

#
# See Wikipedia for xbm description: https://en.wikipedia.org/wiki/X_BitMap
#

set data {#define test_width 16
#define test_height 7
static unsigned char test_bits[] = {
0x13, 0x00, 0x15, 0x00, 0x93, 0xcd, 0x55, 0xa5, 0x93, 0xc5, 0x00, 0x80,
0x00, 0x60 };}

set img [image create bitmap -data $data]
label .l2 -image $img
pack .l2

regsub {0x00} $data {0xff} d2
$img configure -data $d2

-Brian

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor