I want to add image to my postscript code
%!PS-Adobe-3.0
/Times-Roman findfont
12 scalefont setfont
50 700 moveto
(text) show
showpage
bu
See the PostScript Language Reference Manual, this is not a trivial subject and you will need to read carefully. Start with Section 4.10 and read at least the sections dealing with type 1 images (4.10.1 to 4.10.5).
Here is a simple example:
/OneComponentString <007ff700> def
/OneComponentImage1
{
<<
/ImageType 1
/Width 2
/Height 2
/ImageMatrix [2 0 0 -2 0 2]
/BitsPerComponent 8
/Decode [0 1]
/DataSource OneComponentString
>>
} bind def
gsave
0 0 moveto
20 20 scale
/DeviceGray setcolorspace
OneComponentImage1 image
grestore
showpage