052-python庫(kù)PIL(二)

上一篇:051-python庫(kù)PIL(一)

一奈偏、The Image Module(圖像模塊)

The Image module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, and to create new images.

圖像模塊提供了一個(gè)具有相同名稱(chēng)的類(lèi),用于表示一個(gè)庫(kù)的圖像饿序。工廠的模塊還提供了許多功能,包括函數(shù)加載圖片文件,創(chuàng)建新的圖像寇荧。

Examples

The following script loads an image, rotates it 45 degrees, and displays it using an external viewer (usually xv on Unix, and the paint program on Windows).

下面的腳本加載一個(gè)圖像,旋轉(zhuǎn)45度,并顯示它使用一個(gè)外部查看器(通常在Unix中,十五和油漆程序在Windows上)。

  • Open, rotate, and display an image (using the default viewer)(打開(kāi),旋轉(zhuǎn),并顯示一個(gè)圖像(使用默認(rèn)查看器))
from PIL import Image
im = Image.open("bride.jpg")
im.rotate(45).show()

The following script creates nice 128x128 thumbnails of all JPEG images in the current directory.

下面的腳本創(chuàng)建好128 x128當(dāng)前目錄中的所有JPEG圖像的縮略圖。

  • Create thumbnails(創(chuàng)建縮略圖)
from PIL import Image
import glob, os

size = 128, 128

for infile in glob.glob("*.jpg"):
    file, ext = os.path.splitext(infile)
    im = Image.open(infile)
    im.thumbnail(size, Image.ANTIALIAS)
    im.save(file + ".thumbnail", "JPEG")
Functions
  • new

Image.new(mode, size) ? image

Image.new(mode, size, color) ? image

Creates a new image with the given mode and size. Size is given as a (width, height)-tuple, in pixels. The color is given as a single value for single-band images, and a tuple for multi-band images (with one value for each band). In 1.1.4 and later, you can also use color names (see the ImageColor module documentation for details) If the color argument is omitted, the image is filled with zero (this usually corresponds to black). If the color is None, the image is not initialised. This can be useful if you’re going to paste or draw things in the image.

創(chuàng)建一個(gè)新的形象與給定的模式和規(guī)模怯伊。大小是作為(寬度、高度)元組,以像素為單位判沟。給出的顏色作為一個(gè)單一值的單波段圖像,以及多波段圖像的元組(每帶一個(gè)值)耿芹。1.1.4和后,您還可以使用顏色名稱(chēng)(有關(guān)詳細(xì)信息,請(qǐng)參閱ImageColor模塊文檔)如果省略顏色參數(shù),圖像充滿(mǎn)零(這通常對(duì)應(yīng)于黑)。如果沒(méi)有顏色,圖像不是初始化挪哄。這可以有用,如果你要粘貼或畫(huà)的形象吧秕。

from PIL import Image
im = Image.new("RGB", (512, 512), "white")
  • open

Image.open(file) ? image

Image.open(file, mode) ? image

Opens and identifies the given image file. This is a lazy operation; the function reads the file header, but the actual image data is not read from the file until you try to process the data (call the load method to force loading). If the mode argument is given, it must be “r”.

打開(kāi)并識(shí)別給定的圖像文件。這是一個(gè)懶散的操作;函數(shù)讀取文件頭,但實(shí)際圖像數(shù)據(jù)不是從文件讀取,直到你嘗試處理數(shù)據(jù)(調(diào)用load方法強(qiáng)制加載)中燥。如果模式參數(shù)是已知的,它必須是“r”寇甸。

You can use either a string (representing the filename) or a file object as the file argument. In the latter case, the file object must implement read, seek, and tell methods, and be opened in binary mode.

您可以使用一個(gè)字符串(代表文件名)或一個(gè)文件對(duì)象作為參數(shù)的文件。在后一種情況下,文件對(duì)象必須實(shí)現(xiàn)閱讀疗涉、探索,并告訴方法,是在二進(jìn)制模式下打開(kāi)拿霉。

from PIL import Image
im = Image.open("lenna.jpg")
from PIL import image
from StringIO import StringIO

# read data from string
im = Image.open(StringIO(data))
  • blend

Image.blend(image1, image2, alpha) ? image

Creates a new image by interpolating between the given images, using a constant alpha. Both images must have the same size and mode.

創(chuàng)建一個(gè)新的圖像之間的插值給定的圖像,使用一個(gè)常數(shù)α跷叉。圖像都必須有相同的大小和模式迎捺。

out = image1 * (1.0 - alpha) + image2 * alpha

If the alpha is 0.0, a copy of the first image is returned. If the alpha is 1.0, a copy of the second image is returned. There are no restrictions on the alpha value. If necessary, the result is clipped to fit into the allowed output range.

如果α為0.0,返回第一張照片的副本。如果α為1.0,第二個(gè)返回圖像的一個(gè)副本测萎。在alpha值沒(méi)有限制闹伪。如果有必要,結(jié)果剪適應(yīng)允許輸出范圍沪铭。

  • composite

Image.composite(image1, image2, mask) ? image

Creates a new image by interpolating between the given images, using the corresponding pixels from a mask image as alpha. The mask can have mode “1”, “L”, or “RGBA”. All images must be the same size.

之間創(chuàng)建一個(gè)新的圖像插值給定的圖像,使用對(duì)應(yīng)的像素從面具α的形象壮池。面具可以模式“1”、“L”或“RGBA”杀怠。所有圖像都必須是相同的大小椰憋。

  • eval

Image.eval(image, function) ? image

Applies the function (which should take one argument) to each pixel in the given image. If the image has more than one band, the same function is applied to each band. Note that the function is evaluated once for each possible pixel value, so you cannot use random components or other generators.

應(yīng)用函數(shù)(這應(yīng)該采取一個(gè)參數(shù))在給定的圖像每個(gè)像素。如果圖像有多個(gè)樂(lè)隊(duì),相同的功能應(yīng)用到每一個(gè)樂(lè)隊(duì)赔退。注意,函數(shù)為每個(gè)可能的像素值評(píng)估一次,所以你不能使用隨機(jī)組件或其他發(fā)電機(jī)橙依。

  • frombuffer

Image.frombuffer(mode, size, data) ? image

(New in PIL 1.1.4). Creates an image memory from pixel data in a string or buffer object, using the standard “raw” decoder. For some modes, the image memory will share memory with the original buffer (this means that changes to the original buffer object are reflected in the image). Not all modes can share memory; supported modes include “L”, “RGBX”, “RGBA”, and “CMYK”. For other modes, this function behaves like a corresponding call to the fromstring function.

Image.frombuffer(模式、大小數(shù)據(jù))?形象在庫(kù)1.1.4(新)硕旗。創(chuàng)建一個(gè)圖像像素?cái)?shù)據(jù)的內(nèi)存一個(gè)字符串或緩沖區(qū)對(duì)象,使用標(biāo)準(zhǔn)的“原始”解碼器窗骑。對(duì)于一些模式,圖像與原緩沖區(qū)內(nèi)存將共享內(nèi)存(這意味著改變?cè)季彌_區(qū)對(duì)象反映在圖像)。不是所有的模式都能共享內(nèi)存;支持的模式包括“L”漆枚、“RGBX”创译、“RGBA”,“CMYK”。這個(gè)函數(shù)對(duì)于其他模式,像一個(gè)相應(yīng)的調(diào)用fromstring函數(shù)墙基。

Note: In versions up to and including 1.1.6, the default orientation differs from that of fromstring. This may be changed in future versions, so for maximum portability, it’s recommended that you spell out all arguments when using the “raw” decoder:

注意:在版本包括1.1.6,默認(rèn)fromstring取向不同软族。這可能會(huì)改變?cè)谖磥?lái)的版本中,為了獲得最大的可移植性,建議你拼出所有參數(shù)在使用“原始”譯碼器:

im = Image.frombuffer(mode, size, data, "raw", mode, 0, 1)

Image.frombuffer(mode, size, data, decoder, parameters) ? image

Same as the corresponding fromstring call.

相應(yīng)的fromstring調(diào)用一樣。

  • fromstring

Image.fromstring(mode, size, data) ? image

Creates an image memory from pixel data in a string, using the standard “raw” decoder.

創(chuàng)建一個(gè)圖像像素?cái)?shù)據(jù)的內(nèi)存一個(gè)字符串,使用標(biāo)準(zhǔn)的“原始”解碼器碘橘。

Image.fromstring(mode, size, data, decoder, parameters) ? image

Same, but allows you to use any pixel decoder supported by PIL. For more information on available decoders, see the section Writing Your Own File Decoder.

相同,但允許您使用任何像素譯碼器支持的庫(kù)互订。有關(guān)可用解碼器的更多信息,請(qǐng)參見(jiàn)。

Note that this function decodes pixel data only, not entire images. If you have an entire image file in a string, wrap it in a StringIO object, and use open to load it.

注意,這個(gè)函數(shù)解碼像素?cái)?shù)據(jù),不完整的圖像痘拆。如果你有一個(gè)完整的圖像文件在一個(gè)字符串,用StringIO對(duì)象,并使用打開(kāi)加載它仰禽。

  • merge

Image.merge(mode, bands) ? image

Creates a new image from a number of single band images. The bands are given as a tuple or list of images, one for each band described by the mode. All bands must have the same size.

創(chuàng)建一個(gè)新的圖像的單波段圖像。給出了帶一個(gè)元組或圖片列表,每個(gè)樂(lè)隊(duì)所描述的一個(gè)模式纺蛆。所有的樂(lè)隊(duì)都必須有相同的大小吐葵。

Methods

An instance of the Image class has the following methods. Unless otherwise stated, all methods return a new instance of the Image class, holding the resulting image.

圖像類(lèi)的實(shí)例有以下方法。除非另有說(shuō)明,所有方法都返回一個(gè)新實(shí)例的圖像類(lèi),生成圖像桥氏。

  • convert

im.convert(mode) ? image

Converts an image to another mode, and returns the new image.

When converting from a palette image, this translates pixels through the palette. If mode is omitted, a mode is chosen so that all information in the image and the palette can be represented without a palette.

將圖像轉(zhuǎn)換為另一個(gè)模式,并返回新形象温峭。當(dāng)轉(zhuǎn)換從一個(gè)調(diào)色板圖像,這就意味著像素通過(guò)面板。如果省略方式,選擇一個(gè)模式,使所有圖像和調(diào)色板中的信息可以表示沒(méi)有一個(gè)調(diào)色板字支。

When converting from a colour image to black and white, the library uses the ITU-R 601-2 luma transform:

當(dāng)將從彩色圖像轉(zhuǎn)換為黑白,圖書(shū)館使用ITU-R 601 - 2亮度變換:

L = R * 299/1000 + G * 587/1000 + B * 114/1000

When converting to a bilevel image (mode “1”), the source image is first converted to black and white. Resulting values larger than 127 are then set to white, and the image is dithered. To use other thresholds, use the point method. To disable dithering, use the dither= option (see below).

當(dāng)轉(zhuǎn)換到一個(gè)上下兩層的圖像(模式“1”),源圖像首先轉(zhuǎn)換為黑白凤藏。產(chǎn)生的值大于127被設(shè)置成白色,和圖像是猶豫。使用其他閾值,使用的方法堕伪。禁用猶豫不決,使用高頻脈動(dòng)=選項(xiàng)(見(jiàn)下文)揖庄。

im.convert(“P”, **options) ? image

Same, but provides better control when converting an “RGB” image to an 8-bit palette image. Available options are:

相同,但是提供了更好的控制將“RGB圖像轉(zhuǎn)換為一個(gè)8位調(diào)色板圖像∏反疲可用的選項(xiàng)是:

dither=. Controls dithering. The default is FLOYDSTEINBERG, which distributes errors to neighboring pixels. To disable dithering, use NONE.

控制抖動(dòng)蹄梢。默認(rèn)是FLOYDSTEINBERG,鄰近的像素分配錯(cuò)誤。禁用猶豫不決,沒(méi)有使用富俄。

palette=. Controls palette generation. The default is WEB, which is the standard 216-color “web palette”. To use an optimized palette, use ADAPTIVE.

控制面板的一代禁炒。默認(rèn)的網(wǎng)絡(luò),這是標(biāo)準(zhǔn)的216 -顏色“網(wǎng)絡(luò)面板”而咆。使用一個(gè)優(yōu)化面板,使用自適應(yīng)。

colors=. Controls the number of colors used for the palette when palette is ADAPTIVE. Defaults to the maximum value, 256 colors.

控制顏色的數(shù)量用于面板面板時(shí)自適應(yīng)幕袱。默認(rèn)值為最大值,256種顏色暴备。

im.convert(mode, matrix) ? image

Converts an “RGB” image to “L” or “RGB” using a conversion matrix. The matrix is a 4- or 16-tuple.

將“RGB圖像轉(zhuǎn)換為“L”或“RGB”使用一個(gè)轉(zhuǎn)換矩陣。矩陣是一個(gè)4 -或16-tuple们豌。

The following example converts an RGB image (linearly calibrated according to ITU-R 709, using the D65 luminant) to the CIE XYZ colour space:

下面的例子將RGB圖像轉(zhuǎn)換(線性校準(zhǔn)根據(jù)ITU-R 709,使用D65發(fā)光體)到CIE XYZ顏色空間:

Convert RGB to XYZ

rgb2xyz = (
    0.412453, 0.357580, 0.180423, 0,
    0.212671, 0.715160, 0.072169, 0,
    0.019334, 0.119193, 0.950227, 0 )
out = im.convert("RGB", rgb2xyz)
  • copy

im.copy() ? image

Copies the image. Use this method if you wish to paste things into an image, but still retain the original.

復(fù)制圖像馍驯。使用這種方法如果你希望的東西粘貼到一個(gè)圖像,但仍保留原來(lái)的。

  • crop

im.crop(box) ? image

Returns a copy of a rectangular region from the current image. The box is a 4-tuple defining the left, upper, right, and lower pixel coordinate.

This is a lazy operation. Changes to the source image may or may not be reflected in the cropped image. To get a separate copy, call the load method on the cropped copy.

返回一個(gè)復(fù)制當(dāng)前圖像的矩形區(qū)域玛痊。盒子是4-tuple定義左,上,右,和更低的像素坐標(biāo)。這是一個(gè)懶散的操作狂打。源圖像的變化可能是也可能不是反映在裁剪圖像擂煞。一個(gè)單獨(dú)的副本,在裁剪復(fù)制調(diào)用加載方法。

  • draft

im.draft(mode, size)

Configures the image file loader so it returns a version of the image that as closely as possible matches the given mode and size. For example, you can use this method to convert a colour JPEG to greyscale while loading it, or to extract a 128x192 version from a PCD file.

Note that this method modifies the Image object in place (to be precise, it reconfigures the file reader). If the image has already been loaded, this method has no effect.

配置圖像文件加載器所以它返回一個(gè)版本的圖像盡可能匹配給定的模式和規(guī)模趴乡。例如,您可以使用此方法來(lái)顏色JPEG轉(zhuǎn)換為灰度圖時(shí)加載它,或從PCD提取128 x192版本文件对省。注意,這個(gè)方法修改圖像對(duì)象(準(zhǔn)確地說(shuō),它重新配置文件閱讀器)。如果已經(jīng)加載的圖片,這個(gè)方法沒(méi)有效果晾捏。

  • filter

im.filter(filter) ? image

Returns a copy of an image filtered by the given filter. For a list of available filters, see the ImageFilter module.

返回一個(gè)副本給定圖像過(guò)濾的過(guò)濾器蒿涎。有關(guān)可用過(guò)濾的列表,請(qǐng)參見(jiàn)ImageFilter模塊。

  • fromstring

im.fromstring(data)

im.fromstring(data, decoder, parameters)

Same as the fromstring function, but loads data into the current image.

fromstring一樣的功能,但將數(shù)據(jù)加載到當(dāng)前圖像惦辛。

  • getbands

im.getbands() ? tuple of strings

Returns a tuple containing the name of each band. For example, getbands on an RGB image returns (“R”, “G”, “B”).

包含每個(gè)樂(lè)隊(duì)的名稱(chēng)返回一個(gè)元組劳秋。例如,getbands RGB圖像返回(“R”、“G”胖齐、“B”)玻淑。

  • getbbox

im.getbbox() ? 4-tuple or None

Calculates the bounding box of the non-zero regions in the image. The bounding box is returned as a 4-tuple defining the left, upper, right, and lower pixel coordinate. If the image is completely empty, this method returns None.

計(jì)算圖像中零的區(qū)域的邊界框。邊界框返回4-tuple定義左,上,右,和更低的像素坐標(biāo)呀伙。如果圖像完全是空的,這個(gè)方法返回None补履。

  • getcolors

im.getcolors() ? a list of (count, color) tuples or None

im.getcolors(maxcolors) ? a list of (count, color) tuples or None

(New in 1.1.5) Returns an unsorted list of (count, color) tuples, where count is the number of times the corresponding color occurs in the image.

If the maxcolors value is exceeded, the method stops counting and returns None. The default maxcolors value is 256. To make sure you get all colors in an image, you can pass in size[0]*size[1] (but make sure you have lots of memory before you do that on huge images).

1.1.5(新)返回一個(gè)未排序的列表(數(shù)、顏色)元組,在計(jì)數(shù)的次數(shù)對(duì)應(yīng)的顏色出現(xiàn)在圖像剿另。如果超出maxcolors值,停止計(jì)算方法并返回None箫锤。默認(rèn)maxcolors值是256。確保你得到所有顏色的圖片,你可以通過(guò)大小大小[0]*1雨女。

  • getdata

im.getdata() ? sequence

Returns the contents of an image as a sequence object containing pixel values. The sequence object is flattened, so that values for line one follow directly after the values of line zero, and so on.

返回一個(gè)圖像作為一個(gè)序列對(duì)象的內(nèi)容包含像素值谚攒。序列對(duì)象被夷為平地,這值線后直接按照線的值為零,等等。

Note that the sequence object returned by this method is an internal PIL data type, which only supports certain sequence operations, including iteration and basic sequence access. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()).

注意,這個(gè)方法返回的序列對(duì)象內(nèi)部庫(kù)是一種數(shù)據(jù)類(lèi)型,它只支持特定的順序操作,包括迭代和基本順序訪問(wèn)戚篙。將它轉(zhuǎn)換成一個(gè)普通的序列(如打印),使用列表(im.getdata ())五鲫。

  • getextrema

im.getextrema() ? 2-tuple

Returns a 2-tuple containing the minimum and maximum values of the image. In the current version of PIL, this only works for single-band images.

返回一個(gè)二元數(shù)組包含圖像的最小和最大值。在當(dāng)前版本的庫(kù),這只適用于單波段圖像岔擂。

  • getpixel

im.getpixel(xy) ? value or tuple

Returns the pixel at the given position. If the image is a multi-layer image, this method returns a tuple.

Note that this method is rather slow; if you need to process larger parts of an image from Python, you can either use pixel access objects (see load), or thegetdata method.

返回給定的像素位置位喂。如果圖像是一個(gè)多層圖像,該方法返回一個(gè)元組浪耘。注意,這種方法相當(dāng)緩慢;如果你需要從Python處理圖像的放大部分,可以使用像素訪問(wèn)對(duì)象(參見(jiàn)load),或* * getdata * *的方法。

  • histogram

im.histogram() ? list

Returns a histogram for the image. The histogram is returned as a list of pixel counts, one for each pixel value in the source image. If the image has more than one band, the histograms for all bands are concatenated (for example, the histogram for an “RGB” image contains 768 values).

返回圖像的直方圖塑崖。直方圖作為一個(gè)像素統(tǒng)計(jì)列表,返回一個(gè)源圖像的每個(gè)像素值七冲。如果圖像有多個(gè)樂(lè)隊(duì),樂(lè)隊(duì)的直方圖是連接(例如,“RGB圖像的直方圖包含768個(gè)值)。

A bilevel image (mode “1”) is treated as a greyscale (“L”) image by this method.

(上下兩層的圖像模式“1”)都被視為一個(gè)灰度圖像(“L”)的方法规婆。

im.histogram(mask) ? list

Returns a histogram for those parts of the image where the mask image is non-zero. The mask image must have the same size as the image, and be either a bi-level image (mode “1”) or a greyscale image (“L”).

返回一個(gè)直方圖的那部分圖像掩模圖像是零澜躺。掩模圖像形象,必須有相同的大小,是一個(gè)雙層的圖像(“1”模式)或灰度圖像(“L”)。

  • load

im.load()

Allocates storage for the image and loads it from the file (or from the source, for lazy operations). In normal cases, you don’t need to call this method, since the Image class automatically loads an opened image when it is accessed for the first time.

分配存儲(chǔ)圖像并將其加載的文件(或從源懶操作)抒蚜。在正常情況下,您不需要調(diào)用這個(gè)方法,因?yàn)閳D像類(lèi)自動(dòng)加載一個(gè)打開(kāi)圖像時(shí)的首次訪問(wèn)掘鄙。

(New in 1.1.6) In 1.1.6 and later, load returns a pixel access object that can be used to read and modify pixels. The access object behaves like a 2-dimensional array, so you can do:

1.1.6 1.1.6(新)和后,負(fù)載返回一個(gè)像素訪問(wèn)對(duì)象,可用于讀取和修改像素。訪問(wèn)對(duì)象的行為像一個(gè)二維數(shù)組,所以你能做什么:

pix = im.load()
print pix[x, y]
pix[x, y] = value

Access via this object is a lot faster than getpixel and putpixel.

通過(guò)這個(gè)對(duì)象訪問(wèn)比獲取像素和putpixel快很多嗡髓。

  • offset

im.offset(xoffset, yoffset) ? image

(Deprecated) Returns a copy of the image where the data has been offset by the given distances. Data wraps around the edges. If yoffset is omitted, it is assumed to be equal to xoffset.

This method is deprecated, and has been removed in PIL 1.2. New code should use the offset function in the ImageChops module.

(棄用)返回圖像的一個(gè)副本的數(shù)據(jù)已經(jīng)抵消了給定的距離操漠。數(shù)據(jù)封裝邊緣。如果省略yoffset,它被認(rèn)為是等于xoffset饿这。不建議使用這個(gè)方法,在庫(kù)1.2 \刪除浊伙。新代碼應(yīng)該使用(* offset )(http://effbot.org/tag/PIL.ImageChops.offset)功能( * ImageChops * *) (http://effbot.org/imagingbook/imagechops.htm)模塊。

  • paste

im.paste(image, box)

Pastes another image into this image. The box argument is either a 2-tuple giving the upper left corner, a 4-tuple defining the left, upper, right, and lower pixel coordinate, or None (same as (0, 0)). If a 4-tuple is given, the size of the pasted image must match the size of the region.

貼另一個(gè)圖像到這張照片长捧。箱參數(shù)是一個(gè)二元數(shù)組給左上角,4-tuple定義左邊,上,右,和更低的像素坐標(biāo),或沒(méi)有((0,0)一樣)嚣鄙。如果一個(gè)4-tuple,粘貼圖像的大小必須匹配區(qū)域的大小。

If the modes don’t match, the pasted image is converted to the mode of this image (see the convert method for details).

如果模式不匹配,粘貼圖像轉(zhuǎn)換為圖像的模式(有關(guān)詳細(xì)信息,請(qǐng)參閱轉(zhuǎn)換方法)串结。

im.paste(colour, box)

Same as above, but fills the region with a single colour. The colour is given as a single numerical value for single-band images, and a tuple for multi-band images.

同上,但是該地區(qū)充滿(mǎn)了一種單一的顏色哑子。給出的顏色作為一個(gè)單一的數(shù)值為單波段圖像,和多波段圖像的元組。

im.paste(image, box, mask)

Same as above, but updates only the regions indicated by the mask. You can use either “1”, “L” or “RGBA” images (in the latter case, the alpha band is used as mask). Where the mask is 255, the given image is copied as is. Where the mask is 0, the current value is preserved. Intermediate values can be used for transparency effects.

同上,但只更新區(qū)域顯示的面具肌割。您可以使用“1”赵抢、“L”或“RGBA”圖像(在后一種情況下,使用α帶面具)。掩碼是255,給定的圖像復(fù)制声功。面具是0,保存當(dāng)前值烦却。中間值可用于透明效果。

Note that if you paste an “RGBA” image, the alpha band is ignored. You can work around this by using the same image as both source image and mask.

注意,如果您粘貼一個(gè)“RGBA”形象,阿爾法樂(lè)隊(duì)將被忽略先巴。您可以通過(guò)使用相同的解決這個(gè)形象源圖像和面具其爵。

im.paste(colour, box, mask)

Same as above, but fills the region indicated by the mask with a single colour.

同上,但該地區(qū)充滿(mǎn)暗示的面具只有一個(gè)顏色。

  • point

im.point(table) ? image

im.point(function) ? image

Returns a copy of the image where each pixel has been mapped through the given lookup table. The table should contains 256 values per band in the image. If a function is used instead, it should take a single argument. The function is called once for each possible pixel value, and the resulting table is applied to all bands of the image.

返回圖像的一個(gè)副本,每個(gè)像素被映射到給定的查找表伸蚯。表應(yīng)該包含256值/樂(lè)隊(duì)的形象摩渺。如果使用一個(gè)函數(shù)相反,它應(yīng)該采取一個(gè)參數(shù)。函數(shù)被調(diào)用一次對(duì)于每一個(gè)可能的像素值,以及由此產(chǎn)生的表適用于所有樂(lè)隊(duì)的形象剂邮。

If the image has mode “I” (integer) or “F” (floating point), you must use a function, and the function must have the following format:

如果圖像模式“我”(整數(shù))或“F”(浮點(diǎn)),您必須使用一個(gè)函數(shù),函數(shù)必須有以下格式:

argument * scale + offset

Example:

out = im.point(lambda i: i * 1.2 + 10)

You can leave out either the scale or the offset.

im.point(table, mode) ? image

im.point(function, mode) ? image

Same as above, but specifies a new mode for the output image. This can be used to convert “L” and “P” images to “1” in one step, e.g. to threshold an image.

同上,但指定了輸出圖像的新模式摇幻。這可以用于“L”和“P”的圖像轉(zhuǎn)換成“1”在一個(gè)步驟中,如閾值圖像。

(New in 1.1.5) This form can also be used to convert “L” images to “I” or “F”, and to convert “I” images with 16-bit data to “L”. In the second case, you must use a 65536-item lookup table.

1.1.5(新)這種形式還可以用于“L”圖像轉(zhuǎn)換為“我”或“F”,和“我”具有16位的圖像數(shù)據(jù)轉(zhuǎn)換為“L”。在第二種情況下,您必須使用一個(gè)65536項(xiàng)目查找表绰姻。

  • putalpha

im.putalpha(band)

Copies the given band to the alpha layer of the current image.

The image must be an “RGBA” image, and the band must be either “L” or “1”.

將給定頻帶復(fù)制到當(dāng)前圖像的α層枉侧。圖像必須是“RGBA”的形象,和樂(lè)隊(duì)必須“L”或“1”。

(New in PIL 1.1.5) You can use putalpha on other modes as well; the image is converted in place, to a mode that matches the current mode but has an alpha layer (this usually means “LA” or “RGBA”). Also, the band argument can be either an image, or a colour value (an integer).

在庫(kù)1.1.5(新)可以使用putalpha其他模式;圖像的轉(zhuǎn)換,模式匹配當(dāng)前的模式,但有一個(gè)α層(這通常意味著“拉”或“RGBA”)狂芋。同時(shí),樂(lè)隊(duì)參數(shù)可以是一個(gè)圖像,或者顏色值(整數(shù))榨馁。

  • putdata

im.putdata(data)

im.putdata(data, scale, offset)

Copy pixel values from a sequence object into the image, starting at the upper left corner (0, 0). The scale and offset values are used to adjust the sequence values:

將像素值從一個(gè)序列對(duì)象復(fù)制到圖像,從左上角開(kāi)始(0,0)。規(guī)模和偏移量的值是用來(lái)調(diào)整序列值:

pixel = value * scale + offset

If the scale is omitted, it defaults to 1.0. If the offset is omitted, it defaults to 0.0.

如果省略的規(guī)模,它默認(rèn)為1.0帜矾。如果省略偏移量,它默認(rèn)為0.0翼虫。

  • putpalette

im.putpalette(sequence)

Attach a palette to a “P” or “L” image. For an “L” image, the mode is changed to “P”. The palette sequence should contain 768 integer values, where each group of three values represent the red, green, and blue values for the corresponding pixel index. Instead of an integer sequence, you can use a 768-byte string.

附加一個(gè)面板“P”或“L”形象。對(duì)于一個(gè)“L”的形象,“P”的模式改變了屡萤。面板序列應(yīng)該包含768整數(shù)值,每組三個(gè)值代表了紅珍剑、綠、藍(lán)值對(duì)應(yīng)的像素指數(shù)死陆。而不是一個(gè)整數(shù)序列,你可以使用一個(gè)768字節(jié)的字符串次慢。

  • putpixel

im.putpixel(xy, colour)

Modifies the pixel at the given position. The colour is given as a single numerical value for single-band images, and a tuple for multi-band images.

修改像素在給定的位置。給出的顏色作為一個(gè)單一的數(shù)值為單波段圖像,和多波段圖像的元組翔曲。

Note that this method is relatively slow. If you’re using 1.1.6, pixel access objects (see load) provide a faster way to modify the image. If you want to generate an entire image, it can be more efficient to create a Python list and use putdata to copy it to the image. For more extensive changes, use paste or the ImageDraw module instead.

注意,這種方法相對(duì)較慢。如果你使用1.1.6,像素訪問(wèn)對(duì)象(參見(jiàn)負(fù)載)提供一種更快的方式來(lái)修改圖像劈愚。如果你想生成整個(gè)圖像,它可以更有效的創(chuàng)建Python列表并使用putdata復(fù)制圖像瞳遍。對(duì)于更廣泛的變化,使用粘貼或ImageDraw模塊。

You can speed putpixel up a bit by “inlining” the call to the internal putpixel implementation method:

你可以加速putpixel有點(diǎn)“內(nèi)聯(lián)”調(diào)用內(nèi)部putpixel實(shí)現(xiàn)方法:

im.load()
    putpixel = im.im.putpixel
    for i in range(n):
       ...
       putpixel((x, y), value)

In 1.1.6, the above is better written as:

pix = im.load()
    for i in range(n):
        ...
        pix[x, y] = value
  • quantize

**im.quantize(colors, options) ? image

(Deprecated) Converts an “L” or “RGB” image to a “P” image with the given number of colors, and returns the new image.

(棄用)轉(zhuǎn)換為一個(gè)“L”或“RGB圖像到一個(gè)“P”的形象與給定數(shù)量的顏色,并返回新形象菌羽。

For new code, use convert with a adaptive palette instead:

對(duì)于新代碼,使用* convert *與自適應(yīng)面板:

out = im.convert("P", palette=Image.ADAPTIVE, colors=256)
  • resize

im.resize(size) ? image

im.resize(size, filter) ? image

Returns a resized copy of an image. The size argument gives the requested size in pixels, as a 2-tuple: (width, height).

返回一個(gè)縮放圖像的副本掠械。尺寸參數(shù)給請(qǐng)求的大小(以像素為單位),作為一個(gè)二元數(shù)組:(寬度、高度)注祖。

The filter argument can be one of NEAREST (use nearest neighbour), BILINEAR (linear interpolation in a 2x2 environment), BICUBIC (cubic spline interpolation in a 4x4 environment), or ANTIALIAS (a high-quality downsampling filter). If omitted, or if the image has mode “1” or “P”, it is set to NEAREST.

濾波器參數(shù)可以是一個(gè)最近的(使用近鄰),雙線性(2 x2環(huán)境中的線性插值),雙三次的(三次樣條插值在4 x4環(huán)境),或平滑(高質(zhì)量downsampling過(guò)濾器)猾蒂。如果省略,或者圖像模式“1”或“P”,這是最近的。

Note that the bilinear and bicubic filters in the current version of PIL are not well-suited for large downsampling ratios (e.g. when creating thumbnails). You should use ANTIALIAS unless speed is much more important than quality.

注意,雙線性和雙三次的過(guò)濾器在當(dāng)前版本的庫(kù)并不適合大型downsampling比率(例如,當(dāng)創(chuàng)建縮略圖)是晨。您應(yīng)該使用抗鋸齒,除非速度比質(zhì)量更重要肚菠。

  • rotate

im.rotate(angle) ? image

im.rotate(angle, filter=NEAREST, expand=0) ? image

Returns a copy of an image rotated the given number of degrees counter clockwise around its centre.

返回一個(gè)給定數(shù)量的復(fù)制圖像的旋轉(zhuǎn)度逆時(shí)針?lè)较蚶@著它的中心。

The filter argument can be one of NEAREST (use nearest neighbour), BILINEAR (linear interpolation in a 2x2 environment), or BICUBIC (cubic spline interpolation in a 4x4 environment). If omitted, or if the image has mode “1” or “P”, it is set to NEAREST.

濾波器參數(shù)可以是一個(gè)最近的(使用近鄰),雙線性(2 x2環(huán)境中的線性插值),或雙三次的(三次樣條插值在4 x4環(huán)境)罩缴。如果省略,或者圖像模式“1”或“P”,這是最近的蚊逢。

The expand argument, if true, indicates that the output image should be made large enough to hold the rotated image. If omitted or false, the output image has the same size as the input image.

擴(kuò)大的論點(diǎn),如果這是真的,表明輸出圖像應(yīng)該足夠容納旋轉(zhuǎn)圖像。如果遺漏或錯(cuò)誤,輸出圖像具有相同的大小作為輸入圖像箫章。

  • save

im.save(outfile, options…)

im.save(outfile, format, options…)

Saves the image under the given filename. If format is omitted, the format is determined from the filename extension, if possible. This method returns None.

節(jié)省下的圖像文件名烙荷。如果省略格式,該格式文件擴(kuò)展名的確定,如果可能的話。該方法返回None檬寂。

Keyword options can be used to provide additional instructions to the writer. If a writer doesn’t recognise an option, it is silently ignored. The available options are described later in this handbook.

關(guān)鍵字選項(xiàng)可用于提供額外的指令的作家终抽。如果一個(gè)作家不承認(rèn)一個(gè)選項(xiàng),它默默地忽略。在本手冊(cè)描述的可用選項(xiàng)。

You can use a file object instead of a filename. In this case, you must always specify the format. The file object must implement the seek, tell, and write methods, and be opened in binary mode.

您可以使用一個(gè)文件對(duì)象,而不是一個(gè)文件名昼伴。在這種情況下,您必須指定格式匾旭。告訴,文件對(duì)象必須實(shí)現(xiàn)尋求和寫(xiě)作方法,是在二進(jìn)制模式下打開(kāi)。

If the save fails, for some reason, the method will raise an exception (usually an IOError exception). If this happens, the method may have created the file, and may have written data to it. It’s up to your application to remove incomplete files, if necessary.

如果保存失敗,由于某種原因,該方法將引發(fā)一個(gè)異常(通常一個(gè)IOError異常那么)亩码。如果發(fā)生這種情況,該方法可能會(huì)創(chuàng)建這個(gè)文件,并有可能寫(xiě)數(shù)據(jù)季率。由您的應(yīng)用程序?qū)⒉煌暾奈募?如果必要的。

  • seek

im.seek(frame)

Seeks to the given frame in a sequence file. If you seek beyond the end of the sequence, the method raises an EOFError exception. When a sequence file is opened, the library automatically seeks to frame 0.

尋求給定的幀序列文件中描沟。如果你尋求超越的序列,提出了一個(gè)方法EOFError例外飒泻。當(dāng)一個(gè)序列文件打開(kāi),圖書(shū)館自動(dòng)尋求框架0。

Note that in the current version of the library, most sequence formats only allows you to seek to the next frame.

注意,在當(dāng)前版本的庫(kù),大多數(shù)序列格式只允許你尋求下一幀吏廉。

  • show

im.show()

Displays an image. This method is mainly intended for debugging purposes.

顯示一個(gè)圖像泞遗。這種方法主要用于調(diào)試目的。

On Unix platforms, this method saves the image to a temporary PPM file, and calls the xv utility.

在Unix平臺(tái)上,這種方法保存圖像到一個(gè)臨時(shí)PPM文件,并調(diào)用十五的效用席覆。

On Windows, it saves the image to a temporary BMP file, and uses the standard BMP display utility to show it.

在Windows上,它保存圖像到一個(gè)臨時(shí)BMP文件,并使用標(biāo)準(zhǔn)的顯示BMP效用史辙。

This method returns None.

該方法返回None。

作者標(biāo)識(shí)沒(méi)有Mac很絕望佩伤。聊倔。/(ㄒoㄒ)/~~

  • split

im.split() ? sequence

Returns a tuple of individual image bands from an image. For example, splitting an “RGB” image creates three new images each containing a copy of one of the original bands (red, green, blue).

返回一個(gè)元組的個(gè)人形象樂(lè)隊(duì)的形象。例如,將一個(gè)“RGB圖像創(chuàng)建三個(gè)新的圖像每個(gè)包含一份最初的樂(lè)隊(duì)之一(紅生巡、綠耙蔑、藍(lán))。

  • tell

im.tell() ? integer

Returns the current frame number.

返回當(dāng)前幀數(shù)孤荣。

  • thumbnail

im.thumbnail(size)

im.thumbnail(size, filter)

Modifies the image to contain a thumbnail version of itself, no larger than the given size. This method calculates an appropriate thumbnail size to preserve the aspect of the image, calls the draft method to configure the file reader (where applicable), and finally resizes the image.

修改圖像包含的縮略版本身,不超過(guò)給定的大小甸陌。這種方法計(jì)算出一個(gè)合適的圖像的縮略圖大小保存方面,草案方法的調(diào)用配置文件閱讀器(如適用),最后調(diào)整圖像的大小。

The filter argument can be one of NEAREST, BILINEAR, BICUBIC, or ANTIALIAS (best quality). If omitted, it defaults to NEAREST.

濾波器參數(shù)可以最近的之一,雙線性盐股、雙三次的,或平滑(質(zhì)量)钱豁。如果省略,默認(rèn)為最近的。

Note that the bilinear and bicubic filters in the current version of PIL are not well-suited for thumbnail generation. You should use ANTIALIAS unless speed is much more important than quality.

注意,雙線性和雙三次的過(guò)濾器在當(dāng)前版本的庫(kù)并不適合縮略圖生成疯汁。您應(yīng)該使用抗鋸齒,除非速度比質(zhì)量更重要牲尺。

Also note that this function modifies the Image object in place. If you need to use the full resolution image as well, apply this method to a copy of the original image. This method returns None.

還要注意,這個(gè)函數(shù)修改圖像對(duì)象。如果你需要使用完整的分辨率圖像,這種方法適用于原始圖像的一個(gè)副本幌蚊。該方法返回None秸谢。

  • tobitmap

im.tobitmap() ? string

Returns the image converted to an X11 bitmap.

返回圖像轉(zhuǎn)換為一個(gè)X11位圖。

  • tostring

im.tostring() ? string

Returns a string containing pixel data, using the standard “raw” encoder.

返回一個(gè)字符串,其中包含像素?cái)?shù)據(jù),使用標(biāo)準(zhǔn)的“原始”編碼器霹肝。

im.tostring(encoder, parameters) ? string

Returns a string containing pixel data, using the given data encoding.

返回一個(gè)字符串,其中包含像素?cái)?shù)據(jù),使用給定的數(shù)據(jù)編碼估蹄。

Note: The tostring method only fetches the raw pixel data. To save the image to a string in a standard file format, pass a StringIO object (or equivalent) to the save method.

注意:tostring方法只獲取原始像素?cái)?shù)據(jù)。將圖像保存到一個(gè)字符串在標(biāo)準(zhǔn)文件格式,通過(guò)StringIO對(duì)象(或同等)來(lái)保存方法沫换。

  • transform

im.transform(size, method, data) ? image

im.transform(size, method, data, filter) ? image

Creates a new image with the given size, and the same mode as the original, and copies data to the new image using the given transform.

用給定的大小,創(chuàng)建一個(gè)新的形象和與原來(lái)相同的模式,將數(shù)據(jù)復(fù)制到新的圖像使用給定的變換臭蚁。

In the current version of PIL, the method argument can be EXTENT (cut out a rectangular subregion), AFFINE (affine transform), QUAD (map a quadrilateral to a rectangle), MESH (map a number of source quadrilaterals in one operation), or PERSPECTIVE. The various methods are described below.

在當(dāng)前版本的庫(kù),可以將方法參數(shù)范圍(剪出一個(gè)矩形區(qū)),仿射(仿射變換),四(四邊形映射到一個(gè)矩形),網(wǎng)格(映射源四邊形的操作),或觀點(diǎn)最铁。下面描述的各種方法。

The filter argument defines how to filter pixels from the source image. In the current version, it can be NEAREST (use nearest neighbour), BILINEAR (linear interpolation in a 2x2 environment), or BICUBIC (cubic spline interpolation in a 4x4 environment). If omitted, or if the image has mode “1” or “P”, it is set to NEAREST.

濾波器參數(shù)定義了如何從源圖像像素過(guò)濾垮兑。在當(dāng)前版本中,可以是最近的(用近鄰),雙線性(2 x2環(huán)境中的線性插值),或雙三次的(三次樣條插值在4 x4環(huán)境)冷尉。如果省略,或者圖像模式“1”或“P”,這是最近的。

im.transform(size, EXTENT, data) ? image

im.transform(size, EXTENT, data, filter) ? image

Extracts a subregion from the image.

從圖像中提取一個(gè)亞區(qū)系枪。

Data is a 4-tuple (x0, y0, x1, y1) which specifies two points in the input image’s coordinate system. The resulting image will contain data sampled from between these two points, such that (x0, y0) in the input image will end up at (0,0) in the output image, and (x1, y1) at size.

數(shù)據(jù)是一個(gè)4-tuple (x0, y0 (x1, y1)指定輸入圖像中兩個(gè)點(diǎn)的坐標(biāo)系統(tǒng)雀哨。由此產(chǎn)生的圖像將從這兩點(diǎn)之間包含數(shù)據(jù)采樣,這樣(x0, y0)在輸入圖像最終將在輸出圖像(0,0),和(x1, y1)的大小。

This method can be used to crop, stretch, shrink, or mirror an arbitrary rectangle in the current image. It is slightly slower than crop, but about as fast as a corresponding resize operation.

這種方法可用于作物,伸展私爷、收縮或鏡任意矩形在當(dāng)前圖像雾棺。是略低于作物,而是盡快相應(yīng)的調(diào)整操作。

im.transform(size, AFFINE, data) ? image

im.transform(size, AFFINE, data, filter) ? image

Applies an affine transform to the image, and places the result in a new image with the given size.

適用于圖像的仿射變換,將導(dǎo)致一個(gè)新形象與給定的大小衬浑。

Data is a 6-tuple (a, b, c, d, e, f) which contain the first two rows from an affine transform matrix. For each pixel (x, y) in the output image, the new value is taken from a position (a x + b y + c, d x + e y + f) in the input image, rounded to nearest pixel.

數(shù)據(jù)是一個(gè)6-tuple (a, b, c, d, e, f)包含前兩行從一個(gè)仿射變換矩陣捌浩。對(duì)于每個(gè)像素(x, y)在輸出圖像,新價(jià)值從一個(gè)位置(x + b + c, d e x + y + f)在輸入圖像,圓形的最近的像素。

This function can be used to scale, translate, rotate, and shear the original image.

這個(gè)函數(shù)可以用于規(guī)模工秩、翻譯尸饺、旋轉(zhuǎn)和剪切原始圖像。

im.transform(size, QUAD, data) ? image

im.transform(size, QUAD, data, filter) ? image

Maps a quadrilateral (a region defined by four corners) from the image to a rectangle with the given size.

地圖一個(gè)四邊形(區(qū)域定義為四個(gè)角)的形象與給定的一個(gè)矩形的大小助币。

Data is an 8-tuple (x0, y0, x1, y1, x2, y2, y3, y3) which contain the upper left, lower left, lower right, and upper right corner of the source quadrilateral.

數(shù)據(jù)是一個(gè)8-tuple (x0, y0 (x1, y1, x2, y2, y3, y3)含有左上角,左下角,右上角右下方,四邊形的來(lái)源浪听。

im.transform(size, MESH, data) image ? image

im.transform(size, MESH, data, filter) image ? image

Similar to QUAD, but data is a list of target rectangles and corresponding source quadrilaterals.

類(lèi)似于四,但數(shù)據(jù)列表的相應(yīng)目標(biāo)矩形和源的四邊形。

im.transform(size, PERSPECTIVE, data) image ? image

im.transform(size, PERSPECTIVE, data, filter) image ? image

Applies a perspective transform to the image, and places the result in a new image with the given size.

透視變換適用于形象,將導(dǎo)致一個(gè)新形象與給定的大小眉菱。

Data is a 8-tuple (a, b, c, d, e, f, g, h) which contains the coefficients for a perspective transform. For each pixel (x, y) in the output image, the new value is taken from a position (a x + b y + c)/(g x + h y + 1), (d x + e y + f)/(g x + h y + 1) in the input image, rounded to nearest pixel.

數(shù)據(jù)是一個(gè)8-tuple (a, b, c, d, e, f, g, h)包含透視變換的系數(shù)迹栓。對(duì)于每個(gè)像素(x, y)在輸出圖像,新價(jià)值從一個(gè)位置(x + b + c) / (g h x + y + 1) (d e x + y + f) / (g h x + y + 1)在輸入圖像,圓形的最近的像素。

This function can be used to change the 2D perspective of the original image.

這個(gè)函數(shù)可以用來(lái)改變?cè)紙D像的二維角度倍谜。

  • transpose

im.transpose(method) ? image

Returns a flipped or rotated copy of an image.

返回一個(gè)翻轉(zhuǎn)或旋轉(zhuǎn)圖像的副本。

Method can be one of the following: FLIP_LEFT_RIGHT, FLIP_TOP_BOTTOM, ROTATE_90, ROTATE_180, or ROTATE_270.

方法可以是下列之一:叉抡。尔崔。。

  • verify

im.verify()

Attempts to determine if the file is broken, without actually decoding the image data. If this method finds any problems, it raises suitable exceptions. This method only works on a newly opened image; if the image has already been loaded, the result is undefined. Also, if you need to load the image after using this method, you must reopen the image file.

嘗試確定文件壞了,沒(méi)有實(shí)際解碼圖像數(shù)據(jù)褥民。如果這種方法發(fā)現(xiàn)任何問(wèn)題,它提出了合適的異常季春。這種方法只適用于新開(kāi)的形象;如果已經(jīng)加載的圖片,結(jié)果是未定義的。同樣的,如果你需要加載圖像使用這種方法后,你必須重新打開(kāi)圖像文件消返。

Note that this method doesn’t catch all possible errors; to catch decoding errors, you may have to load the entire image as well.

注意,這個(gè)方法沒(méi)有抓住所有可能的錯(cuò)誤;趕上解碼錯(cuò)誤,你可能需要加載整個(gè)圖像载弄。

Attributes

Instances of the Image class have the following attributes:

圖像類(lèi)的實(shí)例有以下屬性:

  • format

im.format ? string or None

The file format of the source file. For images created by the library itself (via a factory function, or by running a method on an existing image), this attribute is set to None.

源文件的文件格式。對(duì)圖像庫(kù)本身創(chuàng)建的(通過(guò)一個(gè)工廠函數(shù),或通過(guò)運(yùn)行方法現(xiàn)有圖像),這個(gè)屬性設(shè)置為None撵颊。

  • mode

im.mode ? string

Image mode. This is a string specifying the pixel format used by the image. Typical values are “1”, “L”, “RGB”, or “CMYK.” See <cite style="font-style: italic; font-weight: normal;">Concepts</cite> for a full list.

圖像模式宇攻。這是一個(gè)字符串指定像素格式所使用的圖像。典型值“1”,“L”倡勇、“RGB”,或“CMYK逞刷。

  • size

im.size ? (width, height)

Image size, in pixels. The size is given as a 2-tuple (width, height).

圖像大小,以像素為單位。是作為二元數(shù)組大小(寬度、高度)夸浅。

  • palette

im.palette ? palette or None

Colour palette table, if any. If mode is “P”, this should be an instance of the ImagePalette class. Otherwise, it should be set to None.

顏色表,如果任何仑最。如果“P”模式,這應(yīng)該是的一個(gè)實(shí)例ImagePalette類(lèi)。否則,它應(yīng)該設(shè)置為None帆喇。

  • info

im.info ? dictionary

A dictionary holding data associated with the image. This dictionary is used by file handlers to pass on various non-image information read from the file. See documentation for the various file handlers for details.

字典數(shù)據(jù)與圖像警医。這本字典文件處理程序通過(guò)使用各種非信息讀取該文件。有關(guān)詳細(xì)信息,請(qǐng)參閱文檔等文件處理程序坯钦。

Most methods ignore the dictionary when returning new images; since the keys are not standardized, it’s not possible for a method to know if the operation affects the dictionary. If you need the information later on, keep a reference to the info dictionary returned from the open method.

大多數(shù)方法忽略了字典當(dāng)返回新的圖像;自鑰匙不是標(biāo)準(zhǔn)化的,這是不可能的知道操作方法影響了字典预皇。如果你需要的信息之后,請(qǐng)引用open的方法。

下一篇:053-python庫(kù)PIL(三)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末葫笼,一起剝皮案震驚了整個(gè)濱河市深啤,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌路星,老刑警劉巖溯街,帶你破解...
    沈念sama閱讀 222,464評(píng)論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異洋丐,居然都是意外死亡呈昔,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,033評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門(mén)友绝,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)堤尾,“玉大人,你說(shuō)我怎么就攤上這事迁客」Γ” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 169,078評(píng)論 0 362
  • 文/不壞的土叔 我叫張陵掷漱,是天一觀的道長(zhǎng)粘室。 經(jīng)常有香客問(wèn)我,道長(zhǎng)卜范,這世上最難降的妖魔是什么衔统? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 59,979評(píng)論 1 299
  • 正文 為了忘掉前任,我火速辦了婚禮海雪,結(jié)果婚禮上锦爵,老公的妹妹穿的比我還像新娘。我一直安慰自己奥裸,他們只是感情好险掀,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,001評(píng)論 6 398
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著湾宙,像睡著了一般迷郑。 火紅的嫁衣襯著肌膚如雪枝恋。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 52,584評(píng)論 1 312
  • 那天嗡害,我揣著相機(jī)與錄音焚碌,去河邊找鬼。 笑死霸妹,一個(gè)胖子當(dāng)著我的面吹牛十电,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播叹螟,決...
    沈念sama閱讀 41,085評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼鹃骂,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了罢绽?” 一聲冷哼從身側(cè)響起畏线,我...
    開(kāi)封第一講書(shū)人閱讀 40,023評(píng)論 0 277
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎良价,沒(méi)想到半個(gè)月后寝殴,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,555評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡明垢,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,626評(píng)論 3 342
  • 正文 我和宋清朗相戀三年蚣常,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片痊银。...
    茶點(diǎn)故事閱讀 40,769評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡抵蚊,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出溯革,到底是詐尸還是另有隱情贞绳,我是刑警寧澤,帶...
    沈念sama閱讀 36,439評(píng)論 5 351
  • 正文 年R本政府宣布致稀,位于F島的核電站冈闭,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏豺裆。R本人自食惡果不足惜拒秘,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,115評(píng)論 3 335
  • 文/蒙蒙 一号显、第九天 我趴在偏房一處隱蔽的房頂上張望臭猜。 院中可真熱鬧,春花似錦押蚤、人聲如沸蔑歌。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 32,601評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)次屠。三九已至园匹,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間劫灶,已是汗流浹背裸违。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,702評(píng)論 1 274
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留本昏,地道東北人供汛。 一個(gè)月前我還...
    沈念sama閱讀 49,191評(píng)論 3 378
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像涌穆,于是被迫代替她去往敵國(guó)和親怔昨。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,781評(píng)論 2 361