std::vector<float> load_jpg(const std::string& file_location) {
Magick::Image image;
image.read( file_location);
image.type(Magick::TrueColorType);
image.colorspaceType(Magick::sRGBColorspace);
size_t width = image.baseColumns();
size_t height = image.baseRows();
std::vector<float> vector(width * height);
Magick::ColorRGB colour;
for (size_t row = 0; row < height; row = row + 1) {
for (size_t column = 0; column < width; column = column + 1) {
colour = image.pixelColor(row, column);
vector[row * width + column] = (float)(0.2126 * colour.red() + 0.7152 * colour.green() + 0.0722 * colour.blue());
}
}
return vector;
}