@@ -1431,9 +1431,8 @@ impl<P: Pixel> ImageBuffer<P, Vec<P::Subpixel>> {
14311431
14321432impl < S , Container > ImageBuffer < Rgb < S > , Container >
14331433where
1434- S : crate :: Primitive +crate :: traits:: Enlargeable ,
1435- Rgb < S > : Pixel ,
1436- Container : DerefMut < Target =[ <Rgb < S > as Pixel >:: Subpixel ] > ,
1434+ Rgb < S > : PixelWithColorType < Subpixel =S > ,
1435+ Container : DerefMut < Target =[ S ] > ,
14371436{
14381437/// Construct an image by swapping `Bgr` channels into an `Rgb` order.
14391438pub fn from_raw_bgr ( width : u32 , height : u32 , container : Container ) ->Option < Self > {
@@ -1458,9 +1457,8 @@ where
14581457
14591458impl < S , Container > ImageBuffer < Rgba < S > , Container >
14601459where
1461- S : crate :: Primitive +crate :: traits:: Enlargeable ,
1462- Rgb < S > : Pixel ,
1463- Container : DerefMut < Target =[ <Rgba < S > as Pixel >:: Subpixel ] > ,
1460+ Rgba < S > : PixelWithColorType < Subpixel =S > ,
1461+ Container : DerefMut < Target =[ S ] > ,
14641462{
14651463/// Construct an image by swapping `BgrA` channels into an `RgbA` order.
14661464pub fn from_raw_bgra ( width : u32 , height : u32 , container : Container ) ->Option < Self > {