2023年4月11日 星期二

RGB to XYZ code example by delphi

procedure XYZToLab(X, Y, Z: Double; out L, a, b: Double);

const

  Xn = 95.047;

  Yn = 100.000;

  Zn = 108.883;

var

  fx, fy, fz: Double;

begin

  // calculate the relative luminance

  fy := Power(Y/Yn, 1/3);

  if Y/Yn <= 0.008856 then

    fy := 7.787 * Y/Yn + 16/116;


  // calculate a and b

  fx := Power(X/Xn, 1/3);

  if X/Xn <= 0.008856 then

    fx := 7.787 * X/Xn + 16/116;


  fz := Power(Z/Zn, 1/3);

  if Z/Zn <= 0.008856 then

    fz := 7.787 * Z/Zn + 16/116;


  L := 116 * fy - 16;

  a := 500 * (fx - fy);

  b := 200 * (fy - fz);

end;





 var

  X, Y, Z, L, a, b: Double;

begin

  // set the XYZ color values

  X := 45.242;

  Y := 52.876;

  Z := 73.215;


  // convert the XYZ color to CIELAB

  XYZToLab(X, Y, Z, L, a, b);


  // output the CIELAB color values

  ShowMessage(Format('L* = %f, a* = %f, b* = %f', [L, a, b]));

end;


色彩空間的 轉換 XYZ to Lab

 procedure XYZToLab(X, Y, Z: Double; out L, a, b: Double);

const

  Xn = 95.047;

  Yn = 100.000;

  Zn = 108.883;

var

  fx, fy, fz: Double;

begin

  // calculate the relative luminance

  fy := Power(Y/Yn, 1/3);

  if Y/Yn <= 0.008856 then

    fy := 7.787 * Y/Yn + 16/116;


  // calculate a and b

  fx := Power(X/Xn, 1/3);

  if X/Xn <= 0.008856 then

    fx := 7.787 * X/Xn + 16/116;


  fz := Power(Z/Zn, 1/3);

  if Z/Zn <= 0.008856 then

    fz := 7.787 * Z/Zn + 16/116;


  L := 116 * fy - 16;

  a := 500 * (fx - fy);

  b := 200 * (fy - fz);

end;



call:

var X, Y, Z, L, a, b: Double; begin // set the XYZ color values X := 45.242; Y := 52.876; Z := 73.215; // convert the XYZ color to CIELAB XYZToLab(X, Y, Z, L, a, b); // output the CIELAB color values ShowMessage(Format('L* = %f, a* = %f, b* = %f', [L, a, b])); end;

2023年3月15日 星期三

stable-diffusion-webui Generate Beautiful picture


Github link:



follow install instruction.


related introduction:

final result picture 



Prompt:
1girl, beautiful, realistic,nude,full size body,lie on bed,pubic,ass

Negative prompt:
Simple background, monochrome, low resolution, bad anatomy, bad hand, text, error, missing fingers, extra digits, fewer digits, cropping, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, low resolution, bad anatomy, bad hand, text, error, extra digits, less digits, cropping, worst quality, low quality, normal quality, jpeg artifacts , signature, watermark, username, blurry, ugly, pregnant, vore, duplicate, morbid, mut ilated, transgender, androgynous, long neck, mutant hands, badly drawn hands, badly drawn face, mutant , deformed, blurred, bad anatomy, bad proportions, misshapen limbs, extra limbs, clone face, disfigurement, gross proportions, missing arms, missing legs, extra arms, extra legs, plump, bad legs, wrong legs, username, blur, bad feet


reference link  to provide keyword:


Models management tool 




3Guofeng3_v32_三國.safetensors

Prompt:
1girl, beautiful, realistic

Negative prompt:
(((simple background))),monochrome ,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, lowres, bad anatomy, bad hands, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, ugly,pregnant,vore,duplicate,morbid,mut ilated,tran nsexual, hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,bad anatomy,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions, (((missing arms))),(((missing legs))), (((extra arms))),(((extra legs))),pubic hair, plump,bad legs,error legs,username,blurry,bad feet


ref link 
https://www.freedidi.com/8621.html
https://www.freedidi.com/9455.html
https://www.freedidi.com/10545.html
https://www.freedidi.com/10494.html

Try following prompt:
 Van Gogh's painting style, landscape, flower


2023年2月23日 星期四

動態島

 "動態島"  這名詞. 這話術.    懂得人都知道 他就是會伸縮的小藥丸.   安卓陣營 應該叫做 "蘋果障眼丸"

2023年2月22日 星期三

228 的平反 與 89-64 平反的預估

  • 1947 年的228 事件 經過了 1995-1947 = 48 年終於平反 . 國民黨認錯. 五年後 西元 2000 最終成為在野黨. 但至今還未消失. 
  • 1989  / 6/4  的 六四 天安門事件  
  • 如果加上48 年   預估 2037  應該會平反, 也就是 4年後  但是 共產黨 的 維穩力度 比 軍備花費還多.
  • 預估 2042 年共產黨 會走向衰敗. 成為在野黨.  (一切都太樂觀了? )
  • 媒體控制的更加嚴密. 應該有更大的誤差.  除非覺醒的中國人數 指數型上升.

今年是 2023  讓我們 耐心的看下去 .這樣的預測準不準.

2023年2月8日 星期三

Line 耗電

 當line開啟了Beacon 的公能. 會持續掃描 藍芽 造成耗電

關閉方式:

  1. 設定(主頁右上角的齒輪)
  2. 隱私設定
  3. 提供使用資料
  4. Line Beacon  關閉
  5. 關閉後的影響
  6. 不會接收某些賣場的 廣告資訊


Line 依你喜好 投放廣告

關閉方式:

  1. 設定(主頁右上角的齒輪)
  2. 隱私設定
  3. 廣告相關設定
    1. 關閉
    2. 關閉
這樣的設定就不會讓你有被監控的感覺 (投放你想買的東西的廣告)

2023年2月6日 星期一

Chat-GPT

Chat-GPT

Chat-GPT


Q: 
windows batch file to create 10 files which contant count of file and file name end with 001 until 010

A:


@echo off
setlocal enabledelayedexpansion
for /l %%i in (1,1,10) do (
    set "count=00%%i"
    set fileName=file_!count:~-3!.txt
    echo File number !count!: !fileName! > !fileName!
)
endlocal
pause