diff --git a/ukis_pysat/raster.py b/ukis_pysat/raster.py
index 1e77d2e..e34b420 100644
--- a/ukis_pysat/raster.py
+++ b/ukis_pysat/raster.py
@@ -10,7 +10,7 @@ try:
     from rasterio import windows
     from rasterio.dtypes import get_minimum_dtype
     from rasterio.io import MemoryFile
-    from rasterio.plot import reshape_as_image
+    from rasterio.plot import reshape_as_image, reshape_as_raster
     from rasterio.warp import calculate_default_transform, reproject
     from rio_toa import reflectance, brightness_temp, toa_utils
     from shapely.geometry import box, polygon
@@ -31,7 +31,8 @@ class Image:
         :param path: str, path to raster (default: None)
         :param dataset: rasterio.io.DatasetReader (default: None)
         :param arr: np.ndarray (default: None)
-        :param dimorder: order of channels or bands 'first' or 'last' (default: 'first)
+        :param dimorder: dimensions order of arr. return channels or bands as 'first' or 'last' dimension. should match
+            the dimensions order of the input array when initializing an image from an array (default: 'first)
         """
         if path:
             if isinstance(path, str):
@@ -42,7 +43,12 @@ class Image:
         else:
             if isinstance(dataset, rasterio.io.DatasetReader) and isinstance(arr, np.ndarray):
                 self.dataset = dataset
-                self.__arr = arr
+                if dimorder == "first":
+                    self.__arr = arr
+                elif dimorder == "last":
+                    self.__arr = reshape_as_raster(arr)
+                else:
+                    raise AttributeError("dimorder for bands or channels must be either 'first' or 'last'.")
             else:
                 raise TypeError(
                     f"dataset must be of type rasterio.io.DatasetReader and arr must be of type " f"numpy.ndarray"

Consider dimorder when initializing Image() from array
It is possible to initialize an Image() object from an existing rasterio.dataset and an array as follows:
```python
img = Image(dataset=ds, array=arr, dimorder="first")
```
To work correctly this assumes that the array is of shape (bands, rows, cols) regardless of parameter setting for dimorder.

Suggest to modify __init__ of Image to consider this case and allow passing arrays of different dimorder. The following would be a working example:

```python
    def __init__(self, path=None, dataset=None, arr=None, dimorder="first"):
        if path:
            if isinstance(path, str):
                self.dataset = rasterio.open(path)
                self.__arr = self.dataset.read()
            else:
                raise TypeError(f"path must be of type str")
        else:
            if isinstance(dataset, rasterio.io.DatasetReader) and isinstance(arr, np.ndarray):
                self.dataset = dataset
                if dimorder == "first":
                    self.__arr = arr
                elif dimorder == "last":
                    self.__arr = reshape_as_raster(arr)
                else:
                    raise AttributeError("dimorder for bands or channels must be either 'first' or 'last'.")
            else:
                raise TypeError(
                    f"dataset must be of type rasterio.io.DatasetReader and arr must be of type " f"numpy.ndarray"
                )
        self.dimorder = dimorder
        self.transform = self.dataset.transform
        self.crs = self.dataset.crs
        self.da_arr = None
```
Please note that this modification would not interfere with any internal array manipulation but just allow for consistent flexible array IO to Image().
diff --git a/tests/test_raster.py b/tests/test_raster.py
index 13fc996..7e7cc02 100644
--- a/tests/test_raster.py
+++ b/tests/test_raster.py
@@ -66,6 +66,13 @@ class DataTest(unittest.TestCase):
             ),
         )
 
+        img = Image(path=os.path.join(os.path.dirname(__file__), "testfiles", "dummy.tif"), dimorder="first")
+        img_first = Image(dataset=img.dataset, arr=np.ones((1, 385, 502)), dimorder="first")
+        self.assertEqual(img_first.arr.shape, (1, 385, 502))
+
+        img_last = Image(dataset=img.dataset, arr=np.ones((385, 502, 1)), dimorder="last")
+        self.assertEqual(img_last.arr.shape, (385, 502, 1))
+
         with self.assertRaises(AttributeError, msg="dimorder for bands or channels must be either 'first' or 'last'."):
             img_first = Image(path=os.path.join(os.path.dirname(__file__), "testfiles", "dummy.tif"), dimorder="middle")
             img_first.arr

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio pytest
apt-get update apt-get install -y gcc
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
affine==2.4.0
alabaster==0.7.13
appdirs==1.4.4
attrs==24.2.0
Babel==2.14.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
chardet==3.0.4
click==7.1.2
click-plugins==1.1.1
cligj==0.7.2
coverage==7.2.7
dask==2.14.0
decopatch==1.4.10
docutils==0.19
exceptiongroup==1.2.2
execnet==2.0.2
Fiona==1.8.22
geographiclib==2.0
geojson==3.2.0
geomet==1.1.0
geopy==2.4.1
html2text==2020.1.16
idna==2.10
imagesize==1.4.1
importlib-metadata==6.7.0
iniconfig==2.0.0
Jinja2==3.1.6
landsatxplore==0.6
makefun==1.15.6
MarkupSafe==2.1.5
munch==4.0.0
numpy==1.18.5
packaging==24.0
pandas==1.0.5
Pillow==7.1.2
pluggy==1.2.0
pyfields==1.1.5
Pygments==2.17.2
pylandsat==0.4
pyparsing==3.1.4
pyproj==2.6.1.post1
pytest==7.4.4
pytest-asyncio==0.21.2
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-xdist==3.5.0
python-dateutil==2.8.2
pytz==2025.2
rasterio==1.1.8
requests==2.23.0
rio-mucho==1.0.0
rio-toa==0.3.0
sentinelsat==0.14
Shapely==1.7.1
six==1.17.0
snowballstemmer==2.2.0
snuggs==1.4.7
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==2.0.1
toolz==0.12.1
tqdm==4.67.1
typing_extensions==4.7.1
-e git+https://github.com/dlr-eoc/ukis-pysat.git@657e294ee8b68baa0cb4059007d9cd977b556be9#egg=ukis_pysat
urllib3==1.25.11
utm==0.5.0
valid8==5.1.2
zipp==3.15.0

name: ukis-pysat
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - affine==2.4.0
      - alabaster==0.7.13
      - appdirs==1.4.4
      - attrs==24.2.0
      - babel==2.14.0
      - chardet==3.0.4
      - click==7.1.2
      - click-plugins==1.1.1
      - cligj==0.7.2
      - coverage==7.2.7
      - dask==2.14.0
      - decopatch==1.4.10
      - docutils==0.19
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - fiona==1.8.22
      - geographiclib==2.0
      - geojson==3.2.0
      - geomet==1.1.0
      - geopy==2.4.1
      - html2text==2020.1.16
      - idna==2.10
      - imagesize==1.4.1
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - landsatxplore==0.6
      - makefun==1.15.6
      - markupsafe==2.1.5
      - munch==4.0.0
      - numpy==1.18.5
      - packaging==24.0
      - pandas==1.0.5
      - pillow==7.1.2
      - pluggy==1.2.0
      - pyfields==1.1.5
      - pygments==2.17.2
      - pylandsat==0.4
      - pyparsing==3.1.4
      - pyproj==2.6.1.post1
      - pytest==7.4.4
      - pytest-asyncio==0.21.2
      - pytest-cov==4.1.0
      - pytest-mock==3.11.1
      - pytest-xdist==3.5.0
      - python-dateutil==2.8.2
      - pytz==2025.2
      - rasterio==1.1.8
      - requests==2.23.0
      - rio-mucho==1.0.0
      - rio-toa==0.3.0
      - sentinelsat==0.14
      - shapely==1.7.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - snuggs==1.4.7
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==2.0.1
      - toolz==0.12.1
      - tqdm==4.67.1
      - typing-extensions==4.7.1
      - urllib3==1.25.11
      - utm==0.5.0
      - valid8==5.1.2
      - zipp==3.15.0
prefix: /opt/conda/envs/ukis-pysat

tests/test_raster.py::DataTest::test_arr
tests/test_raster.py::DataTest::test__lookup_bands tests/test_raster.py::DataTest::test_dn2toa tests/test_raster.py::DataTest::test_get_dask_array tests/test_raster.py::DataTest::test_get_subset tests/test_raster.py::DataTest::test_get_tiles tests/test_raster.py::DataTest::test_get_valid_data_bbox tests/test_raster.py::DataTest::test_init tests/test_raster.py::DataTest::test_mask_image tests/test_raster.py::DataTest::test_warp tests/test_raster.py::DataTest::test_write_to_file
ukis_pysat/raster.py
ukis_pysat/raster.py