diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Juicy Pixels Extra 0.4.0
+
+* Fix `scaleBilinear` so it works correctly with images that have 16-bit
+  components.
+
 ## Juicy Pixels Extra 0.3.0
 
 * Made the function `scaleBilinear` polymorphic in pixel type.
diff --git a/Codec/Picture/Extra.hs b/Codec/Picture/Extra.hs
--- a/Codec/Picture/Extra.hs
+++ b/Codec/Picture/Extra.hs
@@ -9,9 +9,11 @@
 --
 -- Utilities for image transformation with JuicyPixels.
 
-{-# LANGUAGE CPP              #-}
-{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE RecordWildCards  #-}
+{-# LANGUAGE CPP                 #-}
+{-# LANGUAGE FlexibleContexts    #-}
+{-# LANGUAGE RankNTypes          #-}
+{-# LANGUAGE RecordWildCards     #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
 module Codec.Picture.Extra
   ( -- * Scaling
@@ -34,11 +36,13 @@
 import Data.List (foldl1')
 import qualified Codec.Picture.Types as M
 
--- | Scale an image using bi-linear interpolation. This is specialized to
--- 'PixelRGB8' only for speed (polymorphic version is easily written, but
--- it's more than twice as slow).
+-- | Scale an image using bi-linear interpolation.
 
-scaleBilinear :: (Pixel a, Integral (PixelBaseComponent a))
+scaleBilinear
+  :: ( Pixel a
+     , Bounded (PixelBaseComponent a)
+     , Integral (PixelBaseComponent a)
+     )
   => Int               -- ^ Desired width
   -> Int               -- ^ Desired height
   -> Image a           -- ^ Original image
@@ -96,11 +100,15 @@
 mulp pixel x = colorMap (floor . (* x) . fromIntegral) pixel
 {-# INLINE mulp #-}
 
-addp :: (Pixel a, Integral (PixelBaseComponent a)) => a -> a -> a
+addp
+  :: forall a. ( Pixel a
+               , Bounded (PixelBaseComponent a)
+               , Integral (PixelBaseComponent a)
+               ) => a -> a -> a
 addp = mixWith (const f)
   where
     f x y = fromIntegral $
-      (0xff :: Pixel8) `min` (fromIntegral x + fromIntegral y)
+      (maxBound :: PixelBaseComponent a) `min` (fromIntegral x + fromIntegral y)
 {-# INLINE addp #-}
 
 -- | Crop a given image. If supplied coordinates are greater than size of
diff --git a/JuicyPixels-extra.cabal b/JuicyPixels-extra.cabal
--- a/JuicyPixels-extra.cabal
+++ b/JuicyPixels-extra.cabal
@@ -1,7 +1,7 @@
 name:                 JuicyPixels-extra
-version:              0.3.0
-cabal-version:        >= 1.18
-tested-with:          GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
+version:              0.4.0
+cabal-version:        1.18
+tested-with:          GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3
 license:              BSD3
 license-file:         LICENSE.md
 author:               Mark Karpov <markkarpov92@gmail.com>
@@ -27,12 +27,18 @@
 
 library
   build-depends:      base              >= 4.7 && < 5
-                    , JuicyPixels       >= 3.2.6.4 && < 3.3
+                    , JuicyPixels       >= 3.2.6.4 && < 3.4
   exposed-modules:    Codec.Picture.Extra
   if flag(dev)
     ghc-options:      -Wall -Werror
   else
     ghc-options:      -O2 -Wall
+  if flag(dev) && impl(ghc >= 8.0)
+    ghc-options:      -Wcompat
+                      -Wincomplete-record-updates
+                      -Wincomplete-uni-patterns
+                      -Wnoncanonical-monad-instances
+                      -Wnoncanonical-monadfail-instances
   default-language:   Haskell2010
 
 test-suite tests
@@ -40,9 +46,10 @@
   hs-source-dirs:     tests
   type:               exitcode-stdio-1.0
   build-depends:      base              >= 4.7 && < 5
-                    , JuicyPixels       >= 3.2.6.4 && < 3.3
+                    , JuicyPixels       >= 3.2.6.4 && < 3.4
                     , JuicyPixels-extra
                     , hspec             >= 2.0
+  build-tools:        hspec-discover    >= 2.0 && < 3.0
   other-modules:      Codec.Picture.ExtraSpec
   if flag(dev)
     ghc-options:      -Wall -Werror
@@ -55,9 +62,9 @@
   hs-source-dirs:     bench
   type:               exitcode-stdio-1.0
   build-depends:      base              >= 4.7 && < 5.0
-                    , JuicyPixels       >= 3.2.6.4 && < 3.3
+                    , JuicyPixels       >= 3.2.6.4 && < 3.4
                     , JuicyPixels-extra
-                    , criterion         >= 0.6.2.1 && < 1.4
+                    , criterion         >= 0.6.2.1 && < 1.6
   if flag(dev)
     ghc-options:      -O2 -Wall -Werror
   else
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -5,7 +5,6 @@
 [![Stackage Nightly](http://stackage.org/package/JuicyPixels-extra/badge/nightly)](http://stackage.org/nightly/package/JuicyPixels-extra)
 [![Stackage LTS](http://stackage.org/package/JuicyPixels-extra/badge/lts)](http://stackage.org/lts/package/JuicyPixels-extra)
 [![Build Status](https://travis-ci.org/mrkkrp/JuicyPixels-extra.svg?branch=master)](https://travis-ci.org/mrkkrp/JuicyPixels-extra)
-[![Coverage Status](https://coveralls.io/repos/mrkkrp/JuicyPixels-extra/badge.svg?branch=master&service=github)](https://coveralls.io/github/mrkkrp/JuicyPixels-extra?branch=master)
 
 Missing primitives you shouldn't need to re-implement yourself. I think the
 Haddocks are pretty self-explanatory, so head straight to them.
