• AVR Freaks

AnsweredHot!PIC32MZ Harmony Image Resizing/Scaling from USB MSD (Run Time)

Author
TS9
Super Member
  • Total Posts : 732
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: offline
2019/06/12 02:23:43 (permalink)
0

PIC32MZ Harmony Image Resizing/Scaling from USB MSD (Run Time)

Hi,

 Is this possible to display 5 MB Bmp  Image on 4.3 inch TFT 480 x 272 Resolution after down scaling with libaria (Harmony) and PIC32MZ"EF" MCU ?Harmony V2_06 or Harmony 3. 



 Thanks

 --TS9
post edited by TS9 - 2019/06/14 10:40:15
#1
MHGC
Super Member
  • Total Posts : 227
  • Reward points : 0
  • Status: offline
Re: PIC32MZ Harmony Image Resizing/Scaling 2019/06/12 08:53:36 (permalink)
0
Hi,
 
This is a rather open-ended question.  A lot of it is determined by image resolution, color depth and compression and how you wish to store the image (onboard or offboard NVM ).  The largest internal flash version of the MZ EF is only 2 MB in size.
 
The Image Asset Manager within Harmony Composer will let you import the image and massage it to a format that should allow the MZ EF to render it.  You will be able to modify the image using features such as cropping, resizing, adjusting color depth, or using compression or not.
 
Reduction in color depth goes a long way towards reducing the image size.  On an MZ EF, the image really should be 16-bit RGB565 or lower anyway.  One option is to store the image as raw pixels.  The graphics library also supports Run Length Encoding (RLE) and runtime JPEG decoding.  JPEG does a better job at file size reduction with photo-realistic images, while RLE does almost as good a job with images that has a lot of pixels in horizontal of the same color.  However, decoding the image into the frame buffer takes time and you may get undesirable panning as the image is rendered on screen.
 
Storing on external NVM also puts a toll on image rendering time.
 
These are all factors you need to consider.
 
 
#2
TS9
Super Member
  • Total Posts : 732
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: offline
Re: PIC32MZ Harmony Image Resizing/Scaling 2019/06/12 10:04:01 (permalink)
0
Hi MHGC,


Thanks for Update..

1) The Image is 1-Bit BMP (Raw Data) No Compression.
Color Depth 1, Attributes 1.

2) The image is stored in USB MSD or SDCard (External Storage Device).

3)I want to open image from USB MSD resize/scale down it then draw on TFT on run time .


Thanks again

--
TS9
post edited by TS9 - 2019/06/12 10:43:32
#3
MHGC
Super Member
  • Total Posts : 227
  • Reward points : 0
  • Status: offline
Re: PIC32MZ Harmony Image Resizing/Scaling 2019/06/12 10:44:05 (permalink) ☄ Helpfulby TS9 2019/06/17 23:05:00
0
For run time resizing, the Harmony Graphics Suite supports two types: bi-linear and nearest neighbor.  You can access this at Aria Graphics Library or directly call the HAL API.
 
The easiest way to try this out is at the Aria Graphics Library level and use the Image Plus widget in Harmony Graphics Composer.  I suggest you try different settings for the widget and inspect the generated code in libaria_init.c.
 
You will have to try this in Harmony 2 for now.  Full support for MZ EF is coming in Harmony gfx-v3.4.0 (late July/early August).
#4
TS9
Super Member
  • Total Posts : 732
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: offline
Re: PIC32MZ Harmony Image Resizing/Scaling 2019/06/13 10:03:39 (permalink)
0
Hi,


Thank for update..
As for now, my concern is only
1-Bit BMP image.

1)
Is there any demo Harmony 2_06, that can read image from USB MSD and resize/scale down then draw TFT display PIC32MZ"LCC".?

2)
Which functions (Name) are responsible for Bi-linear and nearest neighbour image resize ?

3)
Is there any help documentation Avialable?


--
TS9
post edited by TS9 - 2019/06/13 11:01:09
#5
MHGC
Super Member
  • Total Posts : 227
  • Reward points : 0
  • Status: offline
Re: PIC32MZ Harmony Image Resizing/Scaling 2019/06/17 09:04:42 (permalink) ☼ Best Answerby TS9 2019/06/17 23:05:14
0
1) Is there any demo Harmony 2_06, that can read image from USB MSD and resize/scale down then draw TFT display PIC32MZ "LCC".?


Unfortunately, we do not have a demo that does resize/rescale for PIC32MZ EF LCC.
 
2) There are two ways to access the resize function.  One at the Aria Graphics Library level, where most of this is automatically done for you.  Or application code can access the Hardware Abstraction Layer APIs directly. 
 
If you want to just try out and see what the behavior is like, I highly suggest you try it out by adding an Image Plus Widget in the screen designer within Harmony Graphics Composer.  You can select which resize method from the properties window within Harmony Graphics Composer (See attached image ImagePlusWidget.png)
 
If you want to try accessing the HAL APIs directly, the best example is actually in the image plus widget code itself.  You will want to look at the drawImage function in libaria_widget_imageplus_skin_classic.c.  
 
This will work even if the image is on external NVM.
 
3) The documentation on this feature is rather brief.  Studying the widget code should be more helpful.

Attached Image(s)

#6
TS9
Super Member
  • Total Posts : 732
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: offline
Re: PIC32MZ Harmony Image Resizing/Scaling 2019/06/19 19:13:14 (permalink)
0
Hi MHGC,


I have checked ImagePlusWidget in Harmony 2_06.
Could you request harmony V3.4.0 and/or V 2_07 team for resizing/rescaling demos
for PIC32"EF" and PIC32"DA"
from USB / microSD Cards
?


--
TS9
post edited by TS9 - 2019/06/19 21:32:37
#7
Jump to:
© 2019 APG vNext Commercial Version 4.5