1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $Group="" Invoke-WebRequest "https://i0.wp.com/www.jesusninoc.com/wp-content/uploads/2018/02/910.jpg?ssl=1" -OutFile imagen.jpg $Cave = [System.Drawing.Bitmap]::FromFile('.\imagen.jpg') for ($x = 0;$x -lt $Cave.Height;$x+=1) { for ($y = 0;$y -lt $Cave.Width;$y+=1) { $Group=$Group+"|"+($Cave.GetPixel($y,$x).name).substring(2,6) } } switch(($Group.Split("|") | Group-Object | Sort-Object count | Select-Object -Last 1).name){ {"020202","010101","030303","000000" -contains $_}{"Contiene mucho color negro"} {"ffff00" -contains $_}{"Contiene mucho color amarillo"} } |
Detectar con PowerShell los colores de los que se compone una imagen (PowerShell, Gráficos)
Except where otherwise noted, Jesusninoc by Jesús N. is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.