How to convert a .bmp image to .png?

18 views
Skip to first unread message

johannes

unread,
Feb 9, 2022, 3:47:06 AM2/9/22
to dislin-users
Dear all,
I want to convert a .bmp file into a .png file.
My idea is to use WIMAGE and RPNG, but the simple way does not work.
Which calls or settings have to be added to the following calls ? Or any better solution?

CALL DISLIN()
 
CALL WIMAGE('test.bmp')
 
CALL RPNG('test.png')
CALL DISFIN()

Best regards
Johannes

Helmut Michels

unread,
Feb 9, 2022, 5:20:22 AM2/9/22
to dislin-users
Dear Johannes,

using INCFIL instead of WIMAGE should work. WIMAGE is restricted to image files
of type .img. The Dislin utility 'disbmp' can also convert BMP to PNG files. For example,
the command

       disbmp    xxx.bmp     png        

will create the PNG file xxx.png.

With best regards,

Helmut

johannes

unread,
Feb 9, 2022, 2:21:39 PM2/9/22
to dislin-users
Dear Helmut,
1. Simply replacing WIMAGE by INCFIL does not work:
    <<<< Warning 40: File format and output device are incompatible in incfil!
    <<<< Warning 40: File format and output device are incompatible in rpng!

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    <<                END OF DISLIN / VERSION 11.2.1

Additional statements to be added?

2. DISBMP is not listed in the online ALPHABEITCAL List . Do I have a version problem?

Best regards
Johannes

Helmut Michels

unread,
Feb 9, 2022, 2:49:10 PM2/9/22
to dislin-users
Dear Johannes,

the output format must be a raster format. For example  metafl ('cons') or metafl ('virt').
disbmp is a utility included in the win subdirectory of the Dislin directory. At the moment
I'm not sure if it was already available in the version 11.2.1.

With best regards,

Helmut
Reply all
Reply to author
Forward
0 new messages