# Convert UInt array to bitarray

**URL:** https://discourse.julialang.org/t/convert-uint-array-to-bitarray/65622
**Category:** General Usage
**Tags:** convert
**Created:** [August 1, 2021, 10:41am UTC](https://discourse.julialang.org/t/convert-uint-array-to-bitarray/65622 "2021-08-01T10:41:55Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [August 1, 2021, 1:10pm UTC](https://discourse.julialang.org/t/convert-uint-array-to-bitarray/65622/2 "2021-08-01T13:10:00Z")

</div>

You can take a look here for an efficient approach: [I have: Vector{UInt8}. I need: BitVector](https://discourse.julialang.org/t/i-have-vector-uint8-i-need-bitvector/2286)

Accessing bitarrays element by element is going to be extremely inefficient, so you should try something else.

BTW, I think you probably want your output matrix to be 8x1280 instead of 1280x8. Julia Arrays are column major so neighbors along a column are next to each other in memory, and also linear indexing (which you are using) moves down columns.

---

_[View the full topic](https://discourse.julialang.org/t/convert-uint-array-to-bitarray/65622)._
