Change greyscaled img to black and white in photoshop - photoshop

How can I change in Photoshop CC a greyscaled jpg or pdf to just black and white (no grey and no color)?
I googled around but found nothing in that direction!
THANK YOU!!!

There are multiple ways you can achieve this:
Method 1 - Two color PNG
Open your grayscale image in Photoshop
Go File > Save for Web
Set the file type as PNG-8, Colors: 2
Then you can play with No Dither, Diffusion, Pattern, Noise to achieve different effects
Save...
Method 2 - Use a filter
(I'm using CS6)
Open grayscale image in Photoshop
Go Filter > Filter Gallery > Artistic > Sketch > Stamp
Method 3 - Threshold
(as supplied by Mark Setchell)
Image->Adjustments->Threshold
Alternate Illustrator Method
Open grayscale image in Illustrator
Select the image on the stage, then go Object > Image trace > Make
In the toolbar, there will be an Image Trace Panel button/icon, if you click this you will have options you can play with (Threshold)

one more method:
GO image> adjustment> levels.
In input level collide the three sliders together.
you get different pattern depending on the position of the three sliders.

Related

How to display more than one image dynamically with python (pyqt5)?

I'm using python to build an application by PyQt5, the main idea is to display images from a directory and for each image some masks show up next to it to select one of them (i.e. for each image there are different number of masks). So, I want to display these masks in a "container" that can handle this dynamically.
I tried QlistWidget in a scroll area and the masks are displayed as icons in it, but I want to use something else to handle them easier and retrieve any mask as Qpixmap or QImage to use it in another operations without convert it multiple times (which slows down the program)
this is the part that displays the masks (this is the only way that worked with me)
for ann in annotations:
mask = self.coco.annToMask(ann)
mask_img = Image.fromarray((mask*255).astype(np.uint8))
qt_img = ImageQt.ImageQt(mask_img) # convert Image to ImageQt
icon = QtGui.QIcon(QtGui.QPixmap.fromImage(qt_img))
item = QtWidgets.QListWidgetItem(icon, f"{annIndex}")
self.listWidget.addItem(item)
annIndex += 1

PDF-file thumbnails are shown in wrong color

On a page (TYPO3 Website, ext.: ImageMagick) I want to show thumbnails of available/downloadable pdf-files (always 1st page of the pdf-file as thumbnail). The problem is that the thumbnails (*.gif but I also tried *.jpg and *.png) are created in 'wrong colors', I mean they differ from the pdf content itself (Thumbnails: dark blue color is shown in light blue).
Does anyone has an idea?
This causes PDF with color model CMYK. It will looks fine with ImageMagick when color model is RGB. In such case I prefer to use GraphicsMagick instead of ImageMagick and change the settings in Installtool or LocalConfiguration from for example
$GLOBALS['TYPO3_CONF_VARS']['GFX']['colorspace'] = 'sRGB';
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5'] = 'im6';
to
$GLOBALS['TYPO3_CONF_VARS']['GFX']['colorspace'] = 'RGB';
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5'] = 'gm';

How to correctly position a header image with docx4j?

I am trying to convert this Word document with a header showing an image on the right
http://www.filesnack.com/files/cduiejc7
to PDF using this sample code:
https://github.com/plutext/docx4j/blob/master/src/samples/docx4j/org/docx4j/samples/ConvertOutPDF.java
Here's the result:
http://www.filesnack.com/files/ctjs659h
While the Word document has the header image on the right, the converted PDF shows it on the left.
How can I make docx4j to reproduce the original document as PDF?
Your image is positioned relative to a paragraph:
<w:drawing>
<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="0" relativeHeight="251658240" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1" wp14:anchorId="791936E3" wp14:editId="575B92C8">
<wp:simplePos x="0" y="0"/>
<wp:positionH relativeFrom="column">
<wp:posOffset>5317388</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
<wp:posOffset>-325755</wp:posOffset>
</wp:positionV>
docx4j potential to support stuff like that in PDF output is limited by what XSL FO supports. See docx4j's TextBoxTest class for what we can do with text boxes.
Currently, although we can position some textBoxes; we don't do the same for floating images: https://github.com/plutext/docx4j/issues/127
In the meantime, a possible workaround for some cases (eg float right) is to use a table.
Or possibly, you could try putting the image inside a text box!

How to create json rectangle data from a Photoshop script

I have a photoshop script that is cutting up layers of a PSD file into tiles (it's for a parallax game engine). This works well, but now I want to be able to create regions (rectangles) in the PSD that can be detected by the script and exported as json data.
Can anyone suggest a good way in Photoshop to a) visually create this information in the PSD and b) the script that would write out this data?
Any help would be greatly appreciated - this would remove about 3 manual, error prone steps from our current process if we can solve it...
If it's just rectangles that will hold the data for you then that's easy. You can just create a layer with a unique name, select the area that you need the data for, fill that with a single colour - say bright orange or something that will stand out. So now you have a layer with your region data. In your script get the layer by name
app.documents.getByName("Data_for_Region_1");
...and then you can then export that layer's data (co-ordinates - presumably) as a JSON file with layer bounds.
var x = parseFloat(app.activeDocument;.activeLayer.bounds[0])
var y = parseFloat(app.activeDocument;.activeLayer.bounds[1])
var x1 = parseFloat(app.activeDocument;.activeLayer.bounds[2])
var y1 = parseFloat(app.activeDocument;.activeLayer.bounds[3])
Hope this helps

Opencart thumbnail size

I've just started to work with opencart so I don't very much. I want to change the thumbnail size of my products to a bigger size. So, I've researched on Google and an answer came up. Go to System>Settings, Edit Store and under the Image tab, choose the size I want. The thing is, that is not working and I don't know why. For example, on Best Sellers or on Featured Products, the thumbnail size is always the same, 80x80.
Any help?
Tiago Castro
In OpenCart 1.5.4 it's System > Settings > Edit > Image in the Admin panel.
Most of the modules use the "thumb" size for the home page position but have static image sizes coded for the left/right columns.
You have two options... Either switch the template to pull the thumbnail size:
Edit /catalog/view/theme//module/.tpl
(replace with your theme if you have one and with bestseller.tpl and/or featured.tpl)
replace $product['image'] with $product['thumb']
Although then your thumbnails may be oversized for your left/right columns...
The other option is to edit the controller and specify the size...
Edit /catalog/controller/module/.php (again either bestseller.php or featured.php)
In 1.4.9.x around line 67-68 you will find:
$this->data['products'][] = array( // From line 58
....
....
// Line 67
'image' => $this->model_tool_image->resize($image, 38, 38),
'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')),
Just decide if you want to hardcode the new image size (in this example it is 38x38) or link the 'image' size to the thumbnail size.....
if you are hardcoding it, just c hange the "38, 38"...
If you want to link it to the thumbnail size, just copy the value from 'thumb'
In Admin panel, go to extensions>Features>Edit, in edit mode change 80x80 to anything you like, I assume you want it equal to the rest of the images, if so edit it to match. Repeat for Latest module.
No need to edit any code. Go to:
Extensions -> Modules ->Latest
and you can edit the image size from there.
extensions>features>edit also helped me to increase the size of image in thumbnail. thanks a lot.....
extensions>Features>Edit helped me, I just had to put the same image size that i put in System > Settings > Edit > Image (in Product Image Thumb Size).
I am using the version 1.5.6
For New Opencart version 2.3.0.2 , might help for new versions
you can go to Extensions > Extensions > choose Themes from the 'Choose the extension' type selector and then click > Edit on your theme, to view the Images section and change your image sizes.