Repository: plotters-rs/plotters (language: rust)

Issue:
BitMapElement error with latest `image` crate
I'm using the latest `image` crate ([`0.24.2`](https://docs.rs/image/latest/image/imageops/colorops/index.html)) and I'm trying to do something similar to the [`blit-bitmap`](https://github.com/plotters-rs/plotters/blob/master/examples/blit-bitmap.rs#L34) example. 

In particular, my compilation fails at:

```rust
let elem: BitMapElement<_> = ((0.05, 0.95), image).into();
``` 

The error is the following:

```
the trait bound `plotters::element::BitMapElement<'_, _>: From<(({float}, {float}), DynamicImage)>` is not satisfied
```

If I set the version to image `0.23.14` it works ok, but this would mean losing quite a lot of useful features from the latest release.

Is there a plan to support image `^0.24.*` anytime soon?


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e7b2b248..911e5e4a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,7 +26,7 @@ jobs:
           submodules: recursive
     - uses: actions-rs/toolchain@v1
       with:
-          toolchain: 1.46.0
+          toolchain: 1.56.0
           override: true
     - uses: actions-rs/cargo@v1
       with:
diff --git a/Cargo.toml b/Cargo.toml
index c2b00894..76d68a9e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
 name = "plotters"
 version = "0.3.1"
 authors = ["Hao Hou <haohou302@gmail.com>"]
-edition = "2018"
+edition = "2021"
 license = "MIT"
 description = "A Rust drawing library focus on data plotting for both WASM and native applications"
 repository = "https://github.com/38/plotters"
@@ -32,7 +32,7 @@ pathfinder_geometry = { version = "0.5.1", optional = true }
 font-kit = { version = "0.11.0", optional = true }
 
 [target.'cfg(not(target_arch = "wasm32"))'.dependencies.image]
-version = "0.23.14"
+version = "0.24.2"
 optional = true
 default-features = false
 features = ["jpeg", "png", "bmp"]
diff --git a/README.md b/README.md
index e4eaa55a..fc648fe3 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
     <img style="display: inline! important" src="https://codecov.io/gh/38/plotters/branch/master/graph/badge.svg" />
 </a>
 
-![Minimum Rust version 1.46](https://img.shields.io/badge/rustc-1.46+-06a096.svg)
+![Minimum Rust version 1.56](https://img.shields.io/badge/rustc-1.56+-06a096.svg)
 
 Plotters is drawing library designed for rendering figures, plots, and charts, in pure rust. Plotters supports various types of back-ends, 
 including bitmap, vector graph, piston window, GTK/Cairo and WebAssembly. 
diff --git a/src/element/image.rs b/src/element/image.rs
index f0124872..08b0ae9c 100644
--- a/src/element/image.rs
+++ b/src/element/image.rs
@@ -182,7 +182,7 @@ impl<'a, Coord> From<(Coord, DynamicImage)> for BitMapElement<'a, Coord, RGBPixe
 impl<'a, Coord> From<(Coord, DynamicImage)> for BitMapElement<'a, Coord, BGRXPixel> {
     fn from((pos, image): (Coord, DynamicImage)) -> Self {
         let (w, h) = image.dimensions();
-        let rgb_image = image.to_bgra8().into_raw();
+        let rgb_image = image.to_rgb8().into_raw();
         Self {
             pos,
             image: Buffer::Owned(rgb_image),


Test patch: