Re: [gdal-dev] RGB to PALETTE conversion

2018-02-05 Thread Paulo Pires
Thanks Chris Smemoe and jratike80, I found a solution, thanks to you both. I create my palette image in photoshop, then with gdal, I create my VRT fron that image and then, all my next images with the same colors with rgb2pct... Like a charm. If you know best approach, please let-me know. Thank

Re: [gdal-dev] RGB to PALETTE conversion

2018-02-04 Thread Paulo Pires
theres any help, please? RGB to Palette... CMYK to Palette... Thanks -- Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] RGB to PALETTE conversion

2018-01-23 Thread Paulo Pires
Hello, I'm trying to convert RGB image to PALETTE image with PIL: /img = Image.open(tiffile) img = img1convert("P", palette=Image.ADAPTIVE, colors=256) img.save(newtiffile+"_index.tif") img.close()/ ...but, for example, the white color is 245, not 255 :( And from CMYK to PALETTE? Is it pos

Re: [gdal-dev] CMYK to PALETTE color converter

2017-10-10 Thread Paulo Pires
This is an example: *im.convert('RGB').convert("P", palette=Image.ADAPTIVE, colors=256)* But I have this error: * File "C:\Python27\lib\site-packages\PIL\Image.py", line 926, in convert im = self.im.quantize(colors) ValueError: quantization error* -- Sent from: http://osgeo-org.1560.x6.

[gdal-dev] CMYK to PALETTE color converter

2017-10-10 Thread Paulo Pires
Hello, Is it possible to convert image directely from CMYK to PALETTE color? To do that I need to convert first to RGB... Thanks -- Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html ___ gdal-dev mailing list gdal-dev@lists.osgeo.

Re: [gdal-dev] Convert 3 band RGB image to 1 band indexed color image

2017-07-30 Thread Paulo Pires
Found ;) gdal_translate -of VRT tif vrt Then rgb2pct.py Thanks -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Convert-3-band-RGB-image-to-1-band-indexed-color-image-tp5329771p5329819.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___

[gdal-dev] Convert 3 band RGB image to 1 band indexed color image

2017-07-29 Thread Paulo Pires
Hello Is it possible to convert 3 band RGB image to 1 band indexed color image with gdal command line? Thanks -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Convert-3-band-RGB-image-to-1-band-indexed-color-image-tp5329771.html Sent from the GDAL - Dev mailing list archiv

[gdal-dev] gdal_translate crop tiff (cmyk)

2016-02-13 Thread Paulo Pires
Hello I use the command *gdal_translate *with *-projwin* option to crop a tiff image but I lose the CMYK SOURCE_COLOR_SPACE The croped image is in RGB :/ *D:\raster>gdalinfo D:\raster\cmyk.tif* Driver: GTiff/GeoTIFF Files: D:\raster\cmyk.tif D:\raster\cmyk.tfw Size is 11568, 20061 Coordi

[gdal-dev] shp to raster

2016-02-08 Thread Paulo Pires
Hello I try to use: gdal_rasterize -a xxx -burn 255 -burn 0 -ts 3000 3000 -l xxx aaa.shp bbb.tif for create raster from line shapefile but the output is a black raster... Something is wrong on my command line? Thanks -- View this message in context: http://osgeo-org.1560.x6.nabble.com/shp-

Re: [gdal-dev] Change resolution tiff image

2016-02-08 Thread Paulo Pires
Thanks Even I use TIFFTAG_XRESOLUTION... -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Change-resolution-tiff-image-tp5249156p5249576.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___ gdal-dev mailing list

[gdal-dev] Change resolution tiff image

2016-02-05 Thread Paulo Pires
Hello, I tried to change resolution (dpi) from a raster cmyk file without soccess Is it possible? Change for example 508 to 254 dpi and mantein cmyk mode Thanks -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Change-resolution-tiff-image-tp5249156.html Sent from the GDAL

[gdal-dev] affine transformation (gdaltransform)???

2015-12-30 Thread Paulo Pires
Hello, need help, please... I need to make a affine transformation on shapefile and raster file but I dont know the formula. I already have this variables: /method=poli verbose=N x0y0=[1.1..., 1.1...] alpha=[2.2..., -3.1...] beta=[1.1..., -1.1...] gamma=[0.0, 0.0] delta=[0.0, 0.0] epsilon=[0.0,

[gdal-dev] Edit shapefile gemetry

2015-09-25 Thread Paulo Pires
Hello Whith "from osgeo import ogr" can we edit a shapefile geometry in python code? X and Y? Like setX(...) and setY(...) on existing geometry? Thanks -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Edit-shapefile-gemetry-tp5226076.html Sent from the GDAL - Dev mailing