Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@ImagingSolution
ImagingSolution / imageviewer.py
Last active March 15, 2023 00:11
python image viewer
import tkinter as tk # ウィンドウ作成用
from tkinter import filedialog # ファイルを開くダイアログ用
from PIL import Image, ImageTk # 画像データ用
import numpy as np # アフィン変換行列演算用
import os # ディレクトリ操作用
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.pack()
@ImagingSolution
ImagingSolution / set_get_bright_speed_6.cs
Created November 7, 2019 14:58
【C#】画像の輝度値の取得設定速度の比較
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
var bmp = new Bitmap(@"C:\Temp\syurijou.JPG"); // 6000 x 4000 x 24bit
pictureBox1.Image = bmp;
var sw = new System.Diagnostics.Stopwatch();
MessageBox.Show("開始");
@ImagingSolution
ImagingSolution / set_get_bright_speed_5.cs
Created November 7, 2019 14:56
【C#】画像の輝度値の取得設定速度の比較
/// <summary>
/// usafeのポインタを使って輝度値の取得設定の並列処理
/// </summary>
/// <param name="bmp"></param>
private void NegativeImage5(Bitmap bmp)
{
var width = bmp.Width;
var height = bmp.Height;
// Bitmapをロック
@ImagingSolution
ImagingSolution / set_get_bright_speed_4.cs
Created November 7, 2019 14:55
【C#】画像の輝度値の取得設定速度の比較
/// <summary>
/// usafeのポインタを使って輝度値の取得設定
/// </summary>
/// <param name="bmp"></param>
private void NegativeImage4(Bitmap bmp)
{
var width = bmp.Width;
var height = bmp.Height;
// Bitmapをロック
@ImagingSolution
ImagingSolution / set_get_bright_speed_3.cs
Created November 7, 2019 14:54
【C#】画像の輝度値の取得設定速度の比較
/// <summary>
/// MarshalクラスのReadByte、WriteByteで輝度値の取得設定
/// </summary>
/// <param name="bmp"></param>
private void NegativeImage3(Bitmap bmp)
{
var width = bmp.Width;
var height = bmp.Height;
// Bitmapをロック
@ImagingSolution
ImagingSolution / set_get_bright_speed_2.cs
Created November 7, 2019 14:53
【C#】画像の輝度値の取得設定速度の比較
/// <summary>
/// LockBits、UnlockBitsで画像データのポインタを取得し、配列を介して処理を行う
/// </summary>
/// <param name="bmp"></param>
private void NegativeImage2(Bitmap bmp)
{
var width = bmp.Width;
var height = bmp.Height;
// Bitmapをロック
@ImagingSolution
ImagingSolution / set_get_bright_speed_1.cs
Last active November 8, 2019 13:09
【C#】画像の輝度値の取得設定速度の比較
/// <summary>
/// GetPixel、SetPixelで輝度値の取得設定
/// </summary>
/// <param name="bmp"></param>
private void NegativeImage1(Bitmap bmp)
{
var width = bmp.Width;
var height = bmp.Height;
Color col;