How to Resize Images Efficiently in Tizen for Samsung TV Applications

Original Created May 09, 2020 | Regeneration Apr 22, 2026

I'm developing a Tizen 5.0 application for Samsung TV where I need to display approximately 200 images in a collection view. Due to security restrictions, I cannot use FFImageloading.

The images are currently 900x600 in size, and I want to reduce them by a factor of 3 to save memory. While the initial images load quickly, performance degrades when scrolling through the collection view.

What is the most efficient way to resize these images while maintaining good performance?

Problem Understanding

The developer needs to:

  1. Display a large number of images (200+) in a collection view
  2. Resize images from 900x600 to smaller dimensions (approximately 300x200)
  3. Maintain good performance while scrolling
  4. Work within Tizen 5.0 security constraints that prevent using FFImageloading

Solution Methods

  1. Using SkiaSharp for Image Resizing: SkiaSharp provides efficient image processing capabilities and works within Tizen's security constraints.

Code Examples

public void ImageResizer(string inputPath, string outputPath)
{
    int desiredWidth = 300;  // 1/3 of original width
    int desiredHeight = 200; // 1/3 of original height
    const int quality = 75;  // JPEG quality setting
    
    using (var input = File.OpenRead(inputPath))
    using (var inputStream = new SKManagedStream(input))
    using (var original = SKBitmap.Decode(inputStream))
    {
        using (var resized = original.Resize(
            new SKImageInfo(desiredWidth, desiredHeight), 
            SKBitmapResizeMethod.Lanczos3))
        {
            if (resized == null) return;
            
            using (var image = SKImage.FromBitmap(resized))
            using (var output = File.OpenWrite(outputPath))
            {
                image.Encode(SKEncodedImageFormat.Jpeg, quality)
                    .SaveTo(output);
            }
        }
    }
}

Additional Tips

  1. Consider resizing images during the initial load rather than on-demand
  2. For better performance, you can:
    • Use streams instead of file paths for input/output
    • Implement asynchronous processing
    • Cache resized images
  3. The Lanczos3 resizing method provides good quality but you can experiment with other methods for better performance

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.