Foros del Web » Programando para Internet » PHP »

niveles contraste thumb

Estas en el tema de niveles contraste thumb en el foro de PHP en Foros del Web. Hola amigos. Tengo esta funcion que genera un thumb. He estado buscando para dar un nivel de contraste automatico a cada thumb que se genera. ...
  #1 (permalink)  
Antiguo 17/07/2014, 18:20
 
Fecha de Ingreso: febrero-2014
Mensajes: 99
Antigüedad: 10 años, 2 meses
Puntos: 0
niveles contraste thumb

Hola amigos.
Tengo esta funcion que genera un thumb.
He estado buscando para dar un nivel de contraste automatico a cada thumb que se genera.

Encontre esto -> IMG_FILTER_CONTRAST , pero no se como usarlo.

Alguien me puede echar una mano?

Código PHP:
Ver original
  1. function ak_img_thumb($target, $newcopy, $w, $h, $ext) {
  2.     list($w_orig, $h_orig) = getimagesize($target);
  3.     $src_x = ($w_orig / 2) - ($w / 2);
  4.     $src_y = ($h_orig / 2) - ($h / 2);
  5.     $ext = strtolower($ext);
  6.     $img = "";
  7.     if ($ext == "gif"){
  8.     $img = imagecreatefromgif($target);
  9.     } else if($ext =="png"){
  10.     $img = imagecreatefrompng($target);
  11.     } else {
  12.     $img = imagecreatefromjpeg($target);
  13.     }
  14.     $tci = imagecreatetruecolor($w, $h);
  15.     imagecopyresampled($tci, $img, 0, 0, $src_x, $src_y, $w, $h, $w, $h);
  16.     if ($ext == "gif"){
  17.         imagegif($tci, $newcopy);
  18.     } else if($ext =="png"){
  19.         imagepng($tci, $newcopy);
  20.     } else {
  21.         imagejpeg($tci, $newcopy, 70);
  22.     }
  23. }


Saludos
Gracias
  #2 (permalink)  
Antiguo 17/07/2014, 20:20
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: niveles contraste thumb

Se usa con la función imagefilter()

Supongo que deberás probar diferentes valores hasta que encuentres el que más te guste.
__________________
- León, Guanajuato
- GV-Foto

Etiquetas: niveles, thumb
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:51.