• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Memory usage on loaded bitmaps.

Explorer ,
Feb 05, 2017 Feb 05, 2017

Copy link to clipboard

Copied

Hi,

When loading an image from a folder (1920x1920) and adding to stage, the memory use in Scout goes up to 14.4mb (Bitmap DisplayObjects).

When instantiating the same image from library and adding to stage, the memory stays at 3.6mb.

Am I missing something?

I'm running CS6 with Air 23.

Here's my code:

public function loadBitmap(): void
{
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
loader.load(new URLRequest("app:/assets/images/WIND.png"));
}
function onLoaded(event){
var bitmap:Bitmap = new Bitmap(event.target.content.bitmapData, "auto", true);
addChild(bitmap);
}
function loadFromLibrary(){
var bitmap:Bitmap = new Bitmap(new Wind(0,0), "auto", true);
addChild(bitmap);
}

Regards,

T

TOPICS
Performance issues

Views

454

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 13, 2017 Feb 13, 2017

Copy link to clipboard

Copied

1920x1920x4/1024=14400

Image consist from pixel. Width * height = amount of pixels. Each pixel can use alpha. So without alpha it's 3 channels RGB and with alpha it's 4 channels ARGB. So 1920x1920x4 it's width * height * channels count = 14745600 bytes it's 14 400 kb's or 14.4 mb

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2017 Feb 13, 2017

Copy link to clipboard

Copied

Okay!

So somehow embedded library manages to ignore the alpha channel but still renders alpha?

Since they take 4 times less memory.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 13, 2017 Feb 13, 2017

Copy link to clipboard

Copied

less memory it's 3 channel RGB without 4th - A. You can't use Alpha without it. Without alpha your PNG will be just JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2017 Feb 13, 2017

Copy link to clipboard

Copied

LATEST

Okay thanks!

/T

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines