Invalid bmp format

‘digraph { a → b }’ | dot -Tsvg > output.svg generated an svg file which was successfully displayed
‘digraph { a → b }’ | dot -Tbmp > output.bmp generated a bmp file which was not successfully displayed by Microsoft Paint which stated it was not a valid bmp format similarly for jpg and pdf formats Kindly advise Thank You

Huh, it works OK for me.

  • What OS are you running dot on?
  • What version of Graphviz? (type dot -V)
  • What version of Windows (11?)
  • What is the size of the output file?
  • Does “similarly for jpg and pdf formats” mean that they were also invalid?

What if instead you run
digraph { a → b }’ | dot -Tbmp -o output.bmp

Possibly, redirection of binary output streams fails if Windows is performing text file translation, like mapping newlines in some way. This would be a problem with any program that produces non-text output.

Windows 10
dot - graphviz version 2.50.0 (20211204.2007)
103,064 bytes
Yes jpg pdf also invalid

The advice of scnorth i.e. -o solved the problem i.e. bmp files are now valid However there is now a vertical line at the right edge of the image and a horizontal line at the bottom of the image. Similarly for jpg

graphviz with image boundary lines

Graphviz doesn’t generate a boundary like that.