

So while Android needs compressed textures the most, it’s also the most restrictive. Resize and compress image with HTML Canvas Let’s get to the fun part and make the compressImage function in main.js.

All that is left is to resize and compress the image.

We take the uploaded image, display it to the user, and acquire its dimensions.
JAVASCRIPT PIXI.JS IMAGE COMPRESS FULL
Unfortunately the only compression supported on Android devices at the moment is ETC1, which doesn’t allow alpha. The PixiJS renderer allows everyone to enjoy the power of hardware acceleration without prior knowledge of WebGL. The above listener will trigger whenever a user uploads an image. HTML5 Creation Engine Lightweight 2D JavaScript library Supports both Canvas API and WebGL (since version 5 its only WebGL) Full scene graph, sprite sheets. You pass the binary data to the header function that matches your file type and then use the returned textureData, width, height, and format to setup your compressed texture within WebGL. You can port over the associated header functions from the LoaderParser here: Luckily Phaser-CE actually already handled this. The trickiest part is correctly parsing the loading binary data. This will then allow any image or sprite to use your compressed texture via a normal key reference. ktx), create the compressed WebGL texture, and associate it with a key in the TextureManager. By overriding the onProcess function, we can parse the compressed image file (.pvr. I ended up creating a CompressedImageFile that extends the BinaryFile class. You can write a custom Loader plugin to handle loading of compressed textures. The answer is that as of 3.24.1, Phaser 3 does NOT implement compressed textures but that doesn’t mean that you can’t implement them on your own. To follow up on this for anyone else that stumbles across this in the future.
