# Invalid bmp format

**URL:** <https://forum.graphviz.org/t/invalid-bmp-format/955>\
**Category:** Help\
**Created:** [December 17, 2021, 7:18pm UTC](https://forum.graphviz.org/t/invalid-bmp-format/955 "2021-12-17T19:18:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaltryProgrammer](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@PaltryProgrammer](https://forum.graphviz.org/u/PaltryProgrammer)\
**Post date:** [December 17, 2021, 7:18pm UTC](https://forum.graphviz.org/t/invalid-bmp-format/955/1 "2021-12-17T19:18:19Z")

</div>

‘digraph { a → b }’ | dot -Tsvg \> output.svg generated an svg file which was successfully displayed  
but  
‘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

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [December 17, 2021, 8:50pm UTC](https://forum.graphviz.org/t/invalid-bmp-format/955/2 "2021-12-17T20:50:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [December 18, 2021, 3:49am UTC](https://forum.graphviz.org/t/invalid-bmp-format/955/3 "2021-12-18T03:49:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PaltryProgrammer](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@PaltryProgrammer](https://forum.graphviz.org/u/PaltryProgrammer)\
**Post date:** [December 18, 2021, 5:11am UTC](https://forum.graphviz.org/t/invalid-bmp-format/955/4 "2021-12-18T05:11:08Z")

</div>

> [@PaltryProgrammer](#):
>
> ‘digraph { a → b }’ | dot -Tbmp \> output.bmp

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](https://global.discourse-cdn.com/graphviz/original/1X/3764f0a21cb5658fd0c24071d282f47682a67c8b.png)

---

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [December 18, 2021, 1:23pm UTC](https://forum.graphviz.org/t/invalid-bmp-format/955/5 "2021-12-18T13:23:06Z")

</div>

Graphviz doesn’t generate a boundary like that.
