Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Concept Entry] Python : ImageFilter() #4786

Merged
merged 9 commits into from
Jul 6, 2024

Conversation

cbjazzguitar
Copy link
Contributor

Description

  • added the ImageFilter() term for Python

Issue Solved

Type of Change

  • Adding a new entry
  • Editing an existing entry (fixing a typo, bug, issues, etc)
  • Updating the documentation

Checklist

  • [x ] All writings are my own.
  • [x ] My entry follows the Codecademy Docs style guide.
  • [x ] My changes generate no new warnings.
  • [x ] I have performed a self-review of my own writing and code.
  • [x ] I have checked my entry and corrected any misspellings.
  • [x ] I have made corresponding changes to the documentation if needed.
  • [x ] I have confirmed my changes are not being pushed from my forked main branch.
  • [x ] I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • [ x] I have linked any issues that are relevant to this PR in the Issues Solved section.

@cigar-galaxy82 cigar-galaxy82 self-assigned this Jun 17, 2024
@mamtawardhani
Copy link
Collaborator

Hey @cbjazzguitar the entry is empty, could you please check that once? Thanks! 😃

@cbjazzguitar
Copy link
Contributor Author

cbjazzguitar commented Jun 18, 2024 via email

@cbjazzguitar
Copy link
Contributor Author

cbjazzguitar commented Jun 20, 2024 via email

@mamtawardhani mamtawardhani changed the title [Term Entry] Python : ImageFilter() [Concept Entry] Python : ImageFilter() Jun 28, 2024
@cigar-galaxy82 cigar-galaxy82 added python Python entries new entry New entry or entries status: under review Issue or PR is currently being reviewed pillow Python:Pillow entries labels Jun 28, 2024
Copy link
Collaborator

@cigar-galaxy82 cigar-galaxy82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I have suggested a few changes please modify

@@ -0,0 +1,58 @@
---
Title: ''.imagefilter()'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Title: ''.imagefilter()'
Title: 'ImageFilter'

Subjects:
- 'Code Foundations'
- 'Computer Science'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line 7

@@ -0,0 +1,58 @@
---
Title: ''.imagefilter()'
Description: 'the imagefilter() adds a filter to an image'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Description: 'the imagefilter() adds a filter to an image'
Description: 'Used to apply filters on an image'

Comment on lines 9 to 13
- 'Effects'
- 'Filter'
- 'Functions'
- 'Images'
- 'Methods'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 'Effects'
- 'Filter'
- 'Functions'
- 'Images'
- 'Methods'
- 'Computer Vision'
- 'Effects'
- 'Filter'
- 'Images'
- 'Pillow'

- 'Functions'
- 'Images'
- 'Methods'
CatalogContent: # Please use course/path landing page slugs, rather than linking to individual content items. If listing multiple items, please put the most relevant one first
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CatalogContent: # Please use course/path landing page slugs, rather than linking to individual content items. If listing multiple items, please put the most relevant one first
CatalogContent:


## Syntax

ImageFilter(value1, value2, value3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ImageFilter(value1, value2, value3)
```pseudo
Image.filter(filter)

Comment on lines 25 to 29
The ImageFilter() function takes three parameters:

- 'value1' is required and is the image to perform on.
- 'value2' is the filter to be used.
- 'value3' parameters for the filter.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ImageFilter() function takes three parameters:
- 'value1' is required and is the image to perform on.
- 'value2' is the filter to be used.
- 'value3' parameters for the filter.
- `filter`: A filter that will be applied to the image.

Comment on lines 33 to 41
water_image = imageOne("",400,300,"rgb", "blue");
filter = "water";
water_params = {
radius = 0,
wavelength = 5,
edgeAction = 7,
interpolation = bilinear
};
ImageFilter(image = water_image, filtername = filter, parameters = water_params)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
water_image = imageOne("",400,300,"rgb", "blue");
filter = "water";
water_params = {
radius = 0,
wavelength = 5,
edgeAction = 7,
interpolation = bilinear
};
ImageFilter(image = water_image, filtername = filter, parameters = water_params)
```py
from PIL import Image, ImageFilter
# Open an image file
image = Image.open('example.jpg')
# Apply a filter to the image
filtered_image = image.filter(ImageFilter.SHARPEN)
# Save the filtered image
filtered_image.save("example_blur.jpg")
# show the filtered image
filtered_image.show()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, add an image and display

};
ImageFilter(image = water_image, filtername = filter, parameters = water_params)

This example would a dd a water filter to an image.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This example would a dd a water filter to an image.
The code will show a blurred image.

Comment on lines 45 to 58
## Codebyte Example (if applicable)


```codebyte/python
water_image = imageOne("",400,300,"rgb", "blue");
filter = "water";
water_params = {
radius = 0,
wavelength = 5,
edgeAction = 7,
interpolation = bilinear
};
ImageFilter(image = water_image, filtername = filter, parameters = water_params)
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the image and show how to apply the filter on that and remove the codebyte example as it will not run

@cigar-galaxy82
Copy link
Collaborator

Hi @cbjazzguitar

Thank you for contributing to Codecademy docs, I have suggested a few changes please modify

@cbjazzguitar
Copy link
Contributor Author

cbjazzguitar commented Jun 28, 2024 via email

@mamtawardhani
Copy link
Collaborator

@cigar-galaxy82 Please check this, I guess the author has made the changes you had requested.

@mamtawardhani
Copy link
Collaborator

Please change the tags also @cigar-galaxy82 🙂

@ishg-153 ishg-153 linked an issue Jul 2, 2024 that may be closed by this pull request
3 tasks
@mamtawardhani mamtawardhani self-assigned this Jul 4, 2024
@mamtawardhani mamtawardhani added status: under review Issue or PR is currently being reviewed and removed status: ready for next review labels Jul 4, 2024
Copy link
Collaborator

@mamtawardhani mamtawardhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing to the Codecademy Docs @cbjazzguitar! The entry is well written 😃

I've suggested a few changes for this entry, could you review and modify those at your earliest convenience? Feel free to discuss any concers, thank you! 😄

Comment on lines 1 to 17
---
Title: 'ImageFilter'
Description: 'Used to apply filters on an image'
Subjects:
- 'Code Foundations'
- 'Computer Science'
Tags:
- 'Computer Vision'
- 'Effects'
- 'Filter'
- 'Images'
- 'Pillow
CatalogContent:
- 'learn-python-3'
- 'paths/computer-science'
- 'paths/data-science'
---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---
Title: 'ImageFilter'
Description: 'Used to apply filters on an image'
Subjects:
- 'Code Foundations'
- 'Computer Science'
Tags:
- 'Computer Vision'
- 'Effects'
- 'Filter'
- 'Images'
- 'Pillow
CatalogContent:
- 'learn-python-3'
- 'paths/computer-science'
- 'paths/data-science'
---
---
Title: 'ImageFilter'
Description: 'Provides various image filters such as blur, contour, sharpen, and edge enhancement, allowing image enhancement and manipulation.'
Subjects:
- 'Code Foundations'
- 'Computer Science'
Tags:
- 'Computer Vision'
- 'Effects'
- 'Filter'
- 'Images'
- 'Pillow'
CatalogContent:
- 'learn-python-3'
- 'paths/computer-science'
---

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a better description and ' for Pillow tag

- 'paths/data-science'
---

The **ImageFilter** module helps add different filters to an image. This is used with the `image.filter()` method
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we elaborate on this? Since this is a concept entry, you can talk more about this concept in depth.

## Syntax

```pseudo
Image.filter(filter)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Image.filter(filter)
from PIL import ImageFilter

Comment on lines 26 to 54
`filter`: A filter that will be applied to the image.

## Example

```py
from PIL import Image, ImageFilter

# Open an image file
image = Image.open('example.jpg')

# Apply a filter to the image
filtered_image = image.filter(ImageFilter.SHARPEN)

# Save the filtered image
filtered_image.save("example_blur.jpg")

# show the filtered image
filtered_image.show()

The code will show a blurred image.

image= Image.open(pexels-pixabay-349758.jpg)

filtered_image = image.filter(ImageFilter.SHARPEN)

filtered_image.save("pexels-pixabay-349758_blur.jpg")

filtered_image.show()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`filter`: A filter that will be applied to the image.
## Example
```py
from PIL import Image, ImageFilter
# Open an image file
image = Image.open('example.jpg')
# Apply a filter to the image
filtered_image = image.filter(ImageFilter.SHARPEN)
# Save the filtered image
filtered_image.save("example_blur.jpg")
# show the filtered image
filtered_image.show()
The code will show a blurred image.
image= Image.open(pexels-pixabay-349758.jpg)
filtered_image = image.filter(ImageFilter.SHARPEN)
filtered_image.save("pexels-pixabay-349758_blur.jpg")
filtered_image.show()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a concept entry, an example is not needed here. We can just have the above syntax.

content/pillow/concepts/imagefilter/imagefilter.md Outdated Show resolved Hide resolved
@mamtawardhani mamtawardhani removed the status: under review Issue or PR is currently being reviewed label Jul 4, 2024
Copy link
Collaborator

@mamtawardhani mamtawardhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing @cbjazzguitar 😃

The entry is ready to be merged! 🚀

@mamtawardhani mamtawardhani merged commit 7d786cd into Codecademy:main Jul 6, 2024
6 checks passed
Copy link

github-actions bot commented Jul 6, 2024

👋 @cbjazzguitar
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 Your contribution(s) can be seen here:

https://www.codecademy.com/resources/docs/pillow/imagefilter

Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, see here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Concept Entry] Python Pillow - ImageFilter module
3 participants