1

I want to display on my watchface an image retrieved by my mobile from an api. The size is fixed. For that I use ion and I downscale the image so it fits on the watchface. Then, I send it to the watch using the DataApi.

The problem is that the image is not smooth at all and the edges look pixelised : image.

I've tried those solutions but none of it made a difference :

  • On the mobile side : resizing the bitmap with ion :

    Ion.with(context).load(url).withBitmap().resize(80, 80).centerInside().asBitmap().setCallback(bitmapFutureCallback);

or with Bitmap in bitmapFutureCallback (above):

float side = result.getHeight() > result.getWidth() ? result.getHeight() : result.getWidth();
float scale = 80f / side;
receivingLogo = Bitmap.createScaledBitmap(result,
                                        (int) (result.getWidth() * scale),
                                        (int) (result.getHeight() * scale),
                                        true);
  • On the wear side : setting AntiAlias and FilterBitmap to true on the bitmap paint.

What can I use to smooth the bitmap ?

The image before/after : image

Kapouter
  • 147
  • 10
  • do you have to create a scaled `Bitmap` at all? why not to scale the `Canvas`? – pskink Mar 22 '16 at 09:47
  • I didn't think of it thanks :) But just getting the image kills the app, it's too big – Kapouter Mar 22 '16 at 10:32
  • What does the Bitmap look like on the handheld side before sending it to the wearable? If the quality is already low, then nothing you do on the Wear side will help. Best advice would probably be to retrieve it full-size through Ion, then scale it yourself on the handheld (using `FilterBitmap`) before sending it to Wear. – Sterling Mar 22 '16 at 13:53
  • The original quality is fine. Fitting it into an ImageView on a mobile using `ion` looks nice, but maybe because it's larger than on the watch. I already tried this solution : i tried `Bitmap.createScaledBitmap` and `canvas.drawBitmap` on mobile side, both with filter activated. – Kapouter Mar 22 '16 at 15:09
  • And what does that resized `Bitmap` look like before sending it to the watch? What I'm getting at is that this may have nothing to do with Wear; you need to get the resizing sorted before sending it. Could you maybe add a sample (before and after resizing) to your question? – Sterling Mar 23 '16 at 13:51
  • I edited my question with a before/after image. Yes, that's what i thought too. Maybe i'm trying to downscale too much and that's why i lose quality, although it does the same (less pixelized though) with a 120*120 image. I was wondering if better downscaling algorithms existed. – Kapouter Mar 23 '16 at 15:47

0 Answers0