This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from PIL import Image | |
IMG_PATH = "./assets/water.jpeg" | |
def quantise(pixelList, width, height): | |
pixels = np.array([(q(r), q(g), q(b)) for r, g, b in pixelList], dtype=np.uint8) | |
return pixels.reshape([height, width, 3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.muiz6.example; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.util.TypedValue; | |
import androidx.annotation.AttrRes; | |
import androidx.annotation.ColorInt; | |
import androidx.annotation.ColorRes; | |
import androidx.annotation.NonNull; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> // for specific size integers | |
#include <fstream> // for file handling | |
using namespace std; | |
struct BmpHeader { | |
char bitmapSignatureBytes[2] = {'B', 'M'}; | |
uint32_t sizeOfBitmapFile = 54 + 786432; // total size of bitmap file | |
uint32_t reservedBytes = 0; | |
uint32_t pixelDataOffset = 54; | |
} bmpHeader; |