Writing BMP Files?
am 10.12.2006 13:26:52 von vtatila
Hi,
A simple question, is there a way to do some image processing to Windows BM=
P =
files and write them on disk in BMP as well? I'm trying to convert 24-bit =
bitmaps as produced by Win32::GuiTest to either 1-bit bitmaps, PNg or TIFF =
to save space. I'm grabbing screenshots of zoomed documents actually, to be =
run through Omni Page to make them screen reader accessible, and need to =
save disk space. I could communicate with Irfanview but would prefer a more =
perlish solution. Actually I would rather not write the files on disk but =
keep the BMP data in a Perl scalar and only commit the processed version on =
disk.
I took a look at Image::BMP but it won't write BMP files at all. IF all els=
e =
fails I suppose I could work with modules outputting XBM and run them =
through Image::Xbm2bmp. It would also appear to me that format agnostic =
image processing tools such as Image::Magick and GD don't know Windows =
bitmaps (or pixmaps to be technically accurate), either. At least their doc=
s =
don't mention the format explicitly as far as I can tell.
Lastly, I'm wondering why BMP support isn't more developed than this. MAybe =
it reflects Perl's Unix heritage. Wearing my end-user hat, an app not havin=
g =
BMP support is about as odd as an audio editor that cannot import wave =
files, for a dangerous analogy.
-- =
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/ =
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Writing BMP Files?
am 11.12.2006 11:07:05 von Brian Raven
Veli-Pekka Tätilä <> wrote:
> Hi,
> A simple question, is there a way to do some image processing to
> Windows BMP files and write them on disk in BMP as well? I'm trying
> to convert 24-bit bitmaps as produced by Win32::GuiTest to either
> 1-bit bitmaps, PNg or TIFF to save space. I'm grabbing screenshots of
> zoomed documents actually, to be run through Omni Page to make them
> screen reader accessible, and need to save disk space. I could
> communicate with Irfanview but would prefer a more perlish solution.
> Actually I would rather not write the files on disk but keep the BMP
> data in a Perl scalar and only commit the processed version on disk. =
> =
> I took a look at Image::BMP but it won't write BMP files at all. IF
> all else fails I suppose I could work with modules outputting XBM and
> run them through Image::Xbm2bmp. It would also appear to me that
> format agnostic image processing tools such as Image::Magick and GD
> don't know Windows bitmaps (or pixmaps to be technically accurate),
> either. At least their docs don't mention the format explicitly as
> far as I can tell. =
Have you tried Imager? it seems capable of reading and writing bmp files.
> =
> Lastly, I'm wondering why BMP support isn't more developed than this.
> MAybe it reflects Perl's Unix heritage. Wearing my end-user hat, an
> app not having BMP support is about as odd as an audio editor that
> cannot import wave files, for a dangerous analogy. =
In common with most open source projects, it is probably a reflection of ho=
w many people want something supported enough to volunteer the time and eff=
ort to add it, not to mention having appropriate skills and resources.
HTH
-- =
Brian Raven =
_________________________________________
The information contained in this e-mail is confidential and solely =
for the intended addressee(s). Unauthorised reproduction, disclosure, =
modification, and/or distribution of this email may be unlawful. If you =
have received this email in error, please notify the sender immediately =
and delete it from your system. The views expressed in this message =
do not necessarily reflect those of Atos Euronext Market Solutions.
_________________________________________
==================== =====3D=
========
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
========
The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.
L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Writing BMP Files?
am 11.12.2006 14:40:36 von eroode
Why would anyone use BMPs when more portable, more efficient formats like P=
NG are available?
The reason why there are no Perl modules to write BMPs is simple: Because n=
obody has yet written such a module. Are the specs open, or does Microsoft=
keep them a secret (like XLS and Word formats)? If you see a need for suc=
h a module, perhaps you could contribute to the Perl community. That's the=
only way modules get written. =
Eric J. Roode
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounce=
s@listserv.ActiveState.com] On Behalf Of Veli-Pekka Tätilä
Sent: Sunday, December 10, 2006 7:27 AM
To: activeperl@listserv.ActiveState.com
Subject: Writing BMP Files?
[...]
Lastly, I'm wondering why BMP support isn't more developed than this. MAybe=
it reflects Perl's Unix heritage. Wearing my end-user hat, an app not havi=
ng BMP support is about as odd as an audio editor that cannot import wave f=
iles, for a dangerous analogy.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Writing BMP Files?
am 11.12.2006 16:40:49 von casteele
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
ImageMagick does handle Windows bitmaps and pixmaps -- What it's lacking is=
complete =
documentation how and all the options available. Unfortunately, I've only u=
sed the =
command-line and PHP interface to ImageMagick, so I couldn't tell you how t=
o do it with the =
Image::Magick module. If nothing else, Windows BMP files are pretty simple =
to read and =
write (See http://www.wotsit.org/search.asp?s=3DBMP ).
Also, according to the POD in Win32::GuiTest, it can write the DIB to a BMP=
file already =
(look for DibSect::SaveAs).. Then run whatever processing tool you need to =
create a more =
compressed image, and delete the BMP file (which again, ImageMagick comes w=
ith a =
command-line convert program to do just that). Optionally, if you look belo=
w even the =
"SaveAs" function, there's a "ToClipboard" function that you can use to pas=
s it to some other =
image processing app, send the appropriate keystrokes (using "SendKeys") to=
paste it, save =
it, etc etc. Or, again, you can just parse the data from GuiTest and create=
a data structure =
appropriate for whatever tool you want to use.
In short, there's already a lot of ways to do what you want.. Just depends =
how lazy you want =
to be..
Cas
On 11 Dec 2006 at 10:07, Brian Raven wrote:
> Veli-Pekka Tätilä <> wrote:
> > Hi,
> > A simple question, is there a way to do some image processing to
> > Windows BMP files and write them on disk in BMP as well? I'm trying
> > to convert 24-bit bitmaps as produced by Win32::GuiTest to either
> > 1-bit bitmaps, PNg or TIFF to save space. I'm grabbing screenshots of
> > zoomed documents actually, to be run through Omni Page to make them
> > screen reader accessible, and need to save disk space. I could
> > communicate with Irfanview but would prefer a more perlish solution.
> > Actually I would rather not write the files on disk but keep the BMP
> > data in a Perl scalar and only commit the processed version on disk. =
> > =
> > I took a look at Image::BMP but it won't write BMP files at all. IF
> > all else fails I suppose I could work with modules outputting XBM and
> > run them through Image::Xbm2bmp. It would also appear to me that
> > format agnostic image processing tools such as Image::Magick and GD
> > don't know Windows bitmaps (or pixmaps to be technically accurate),
> > either. At least their docs don't mention the format explicitly as
> > far as I can tell. =
> =
> Have you tried Imager? it seems capable of reading and writing bmp files.
> =
> > =
> > Lastly, I'm wondering why BMP support isn't more developed than this.
> > MAybe it reflects Perl's Unix heritage. Wearing my end-user hat, an
> > app not having BMP support is about as odd as an audio editor that
> > cannot import wave files, for a dangerous analogy. =
> =
> In common with most open source projects, it is probably a reflection of =
how many people want something supported enough to volunteer the time and e=
ffort to add it, not to mention having appropriate skills and resources.
> =
> HTH
> =
> -- =
> Brian Raven =
> =
> _________________________________________
> =
> The information contained in this e-mail is confidential and solely =
> for the intended addressee(s). Unauthorised reproduction, disclosure, =
> modification, and/or distribution of this email may be unlawful. If you =
> have received this email in error, please notify the sender immediately =
> and delete it from your system. The views expressed in this message =
> do not necessarily reflect those of Atos Euronext Market Solutions.
> _________________________________________
> =
> =
> =
> ==================== =====
=========3D
> Atos Euronext Market Solutions Disclaimer
> ==================== =====
=========3D
> The information contained in this e-mail is confidential and solely for t=
he intended addressee(s). Unauthorised reproduction, disclosure, modificati=
on, and/or distribution of this email may be unlawful.
> If you have received this email in error, please notify the sender immedi=
ately and delete it from your system. The views expressed in this message d=
o not necessarily reflect those of Atos Euronext Market Solutions.
> =
> L'information contenue dans cet e-mail est confidentielle et uniquement d=
estinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. T=
oute copie, publication ou diffusion de cet email est interdite. Si cet e-m=
ail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'e=
xpediteur immediatement et d'effacer le e-mail et annexes jointes de votre =
systeme. Le contenu de ce message electronique ne represente pas necessaire=
ment la position ou le point de vue d'Atos Euronext Market Solutions.
> =
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3rc1 (MingW32)
iD8DBQFFfXwCtSHnwqiHnD4RAkAXAJ90pp4Gms7/2QdVi/rUGZ6VjI5ukgCf cHV9
TrCvDS/t+tbYRcC71iUj36A=3D
=3DvPrx
-----END PGP SIGNATURE-----
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Writing BMP Files?
am 11.12.2006 18:33:28 von John Mason Jr
Veli-Pekka Tätilä wrote:
> Hi,
> A simple question, is there a way to do some image processing to Windows =
BMP =
> files and write them on disk in BMP as well? I'm trying to convert 24-bit =
> bitmaps as produced by Win32::GuiTest to either 1-bit bitmaps, PNg or TIF=
F =
> to save space. I'm grabbing screenshots of zoomed documents actually, to =
be =
> run through Omni Page to make them screen reader accessible, and need to =
> save disk space. I could communicate with Irfanview but would prefer a mo=
re =
> perlish solution. Actually I would rather not write the files on disk bu=
t =
> keep the BMP data in a Perl scalar and only commit the processed version =
on =
> disk.
> =
> I took a look at Image::BMP but it won't write BMP files at all. IF all e=
lse =
> fails I suppose I could work with modules outputting XBM and run them =
> through Image::Xbm2bmp. It would also appear to me that format agnostic =
> image processing tools such as Image::Magick and GD don't know Windows =
> bitmaps (or pixmaps to be technically accurate), either. At least their d=
ocs =
> don't mention the format explicitly as far as I can tell.
> =
> Lastly, I'm wondering why BMP support isn't more developed than this. MAy=
be =
> it reflects Perl's Unix heritage. Wearing my end-user hat, an app not hav=
ing =
> BMP support is about as odd as an audio editor that cannot import wave =
> files, for a dangerous analogy.
> =
In chapter two of Graphics Programing with Perl
look for the convert.pl in
John
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Writing BMP Files?
am 11.12.2006 19:24:09 von vtatila
Casteele/ShadowLord wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> ImageMagick does handle Windows bitmaps and pixmaps -- What it's
> lacking is complete documentation
i see, good to know it can pull this off.
> Also, according to the POD in Win32::GuiTest, it can write the DIB to
> a BMP file already (look for DibSect::SaveAs).. Then run whatever
> processing tool you need to create a more compressed image
I already know the DibSect sub-module, before posting I used just that to =
write out BMP files on disk. My mention of Irfanview implied that I already=
, =
in fact, ran my outputted files through the app to convert the BMP files. =
But I'd like to avoid this extra step and use Perl in stead. Also over 1000 =
1024x768 screen captures take literally gigs of disk space that I'd like to =
save. Lastly, the images have 2 or 4 colors in them actually so 24-bits per =
pixel is definite overkill and even run length encoding would save plenty o=
f =
space, as the background is white.
> ToClipboard" function that you can use to pass it to some other image =
> processing
That's right, but using sendkeys to manage a graphics app feels risky. =
There's no telling what the script might do in eronious situations or if th=
e =
wrong window gets the focus. So I'd prefer native Perl support, OLE =
automation and command-line apps like Irfan in this order. I do use sendkey=
s =
occasionally but only as the last resort.
Thanks for your help.
-- =
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/ =
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Writing BMP Files?
am 11.12.2006 19:35:01 von vtatila
Brian Raven wrote:
> Veli-Pekka Tätilä <> wrote:
>> A simple question, is there a way to do some image processing to
>> Windows BMP files and write them on disk in BMP as well? I'm trying
>> to convert 24-bit bitmaps as produced by Win32::GuiTest to either
>> 1-bit bitmaps, PNg or TIFF to save space.
> Have you tried Imager? it seems capable of reading and writing bmp
> files.
Nope, I missed that module in my PPM searches as I don't have the =
descriptions on, to give as terse screen reader output as you can get. Well =
just installed it and it seems imager is able to do the conversions, and a=
s =
a bonus, much of the stuff I'd use GD for, too. And the best part is, this =
module has docs for the BMP specific bits.
So far this module looks like an optimal fit for my needs, although I'll =
have to read some of the docs to figure out how it works. That shouldn't =
pose any major problems, though. I've noticed that few OO:ish Perl modules =
are as abstract as those in Java, which I mainly view as a good thing for =
programming in the small.
-- =
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/ =
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
FW: RE: Writing BMP Files?
am 12.12.2006 18:22:17 von James Deming
--===============1768169508==
Content-type: text/plain; charset=US-ASCII
> Veli-Pekka Tätilä <> wrote below-----
I echo Brian Raven comment and others. If it is important to you and
others, pick up the gauntlet and go forward. For me, I view BMP as
Microsoft's early baby-steps into graphics. They tried to sell/train
programmers by providing "the red brick" (for search use 'redbrick').
http://msdn.microsoft.com/library/en-us/gdi/bitmaps_5jhv.asp
BMP should never be used in a production environment, it does not 'scale.'
http://en.wikipedia.org/wiki/Scaling_%28computer_network%29
It does have merit as a learning tool. Just as bubble sorts are bad, but
good.
As a learning exercise for JavaScript & BMP I wrote script to create a
16x16 BMP file.
http://home.earthlink.net/~jimdeming/JavaScript/BMP16x16.htm l
This was over 4 years ago and any plans of enhancement are vanished. Don't
try to run it on the Web, it functions only on a MS disk, the C: drive.
WARNING:ASSUMPTIONS:a Microsoft Platform is expected, MS IE browser,
ActiveX control with write permissions and the MS-DOS program 'debug.exe'
(which came with your MS-DOS).
This 256-byte file, jd.bmp, was created using it.
http://home.earthlink.net/~jimdeming/jd.bmp
Between 'silly-bits' I am learning Perl/Tk, maybe another BMP creation
exercise is in my future. Any good URLs on Perl/Tk would be appreciated.
One of my 'silly-bits' is - http://www.youtube.com/watch?v=N3qfqlMvkR4
Answers:
My first program was on an IBM 1620 in 1961 using the dead language GOTRAN.
Yes, W.E.Deming was a 7th cousin of my grandfather.
Jim Deming
jimdeming@earthlink.net
> [Original Message]
> From: Brian Raven
> To:
> Date: 12/11/2006 5:07:42 AM
> Subject: RE: Writing BMP Files?
>
> Veli-Pekka Tätilä <> wrote:
> > Hi,
> > A simple question, is there a way to do some image processing to
> > Windows BMP files and write them on disk in BMP as well? I'm trying
> > to convert 24-bit bitmaps as produced by Win32::GuiTest to either
> > 1-bit bitmaps, PNg or TIFF to save space. I'm grabbing screenshots of
> > zoomed documents actually, to be run through Omni Page to make them
> > screen reader accessible, and need to save disk space. I could
> > communicate with Irfanview but would prefer a more perlish solution.
> > Actually I would rather not write the files on disk but keep the BMP
> > data in a Perl scalar and only commit the processed version on disk.
> >
> > I took a look at Image::BMP but it won't write BMP files at all. IF
> > all else fails I suppose I could work with modules outputting XBM and
> > run them through Image::Xbm2bmp. It would also appear to me that
> > format agnostic image processing tools such as Image::Magick and GD
> > don't know Windows bitmaps (or pixmaps to be technically accurate),
> > either. At least their docs don't mention the format explicitly as
> > far as I can tell.
>
> Have you tried Imager? it seems capable of reading and writing bmp files.
>
> >
> > Lastly, I'm wondering why BMP support isn't more developed than this.
> > MAybe it reflects Perl's Unix heritage. Wearing my end-user hat, an
> > app not having BMP support is about as odd as an audio editor that
> > cannot import wave files, for a dangerous analogy.
>
> In common with most open source projects, it is probably a reflection of
how many people want something supported enough to volunteer the time and
effort to add it, not to mention having appropriate skills and resources.
>
> HTH
>
> --
> Brian Raven
>
> _________________________________________
>
> The information contained in this e-mail is confidential and solely
> for the intended addressee(s). Unauthorised reproduction, disclosure,
> modification, and/or distribution of this email may be unlawful. If you
> have received this email in error, please notify the sender immediately
> and delete it from your system. The views expressed in this message
> do not necessarily reflect those of Atos Euronext Market Solutions.
> _________________________________________
>
>
>
> =================================
> Atos Euronext Market Solutions Disclaimer
> =================================
> The information contained in this e-mail is confidential and solely for
the intended addressee(s). Unauthorised reproduction, disclosure,
modification, and/or distribution of this email may be unlawful.
> If you have received this email in error, please notify the sender
immediately and delete it from your system. The views expressed in this
message do not necessarily reflect those of Atos Euronext Market Solutions.
>
> L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet
e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de
votre systeme. Le contenu de ce message electronique ne represente pas
necessairement la position ou le point de vue d'Atos Euronext Market
Solutions.
>
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1768169508==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1768169508==--